MySQL 权限管理

2.1 查看用户权限

#show grants for ‘用户名’@’主机名’
mysql> show grants for ‘mytest’@’%’;

2.2 用户授权

#grant 权限列表 on 数据库名.表名 to ‘用户名’@’主机名’; (多个权限需要使用逗号隔开)
mysql> grant all on *.* to ‘mytest’@’%’;

2.3 取消权限

#revoke 权限列表 on 数据库名.表名 from ‘用户名’@’主机名’;
mysql> revoke select on company.account from ‘mytest’@’%’;

0

评论0

请先
显示验证码
没有账号?注册  忘记密码?