数据库的权限

mysql 数据的权限实质都是在 user 表里控制的

1、grant

grant all on *.* to 'ads'@'localhost' identified by '123456' with grant oprion;
# all:所有的权限
# *.*:所有数据库下面的所有表
# 'ads':用户
# 'localhost':用户 ip
# '123456':密码
# with grant oprion:有执行grant 语句的权限


2、修改 user 表的数据

flush privileges; #刷新权限


3、取消权限 --- revoke

revoke all on *.* from ads@localhost;

猜你喜欢

转载自www.cnblogs.com/lynn-chen/p/9010822.html