mysql用户授权

show grants for 'liangliang'@'%';

 

 

SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user; 查看所有用户及权限

 

 

grant all on *.* to 'liangliang'@'%'; 授与量量用户所有权限

 

grant all privileges  on *.* to root@'%' identified by "password";允许root用户远程登录 

flush privileges;

 刷新权限

 select host,user,password from user ;查看用户密码设置

 set global read_only=1;普通账号的只读模式

set global super_read_only=1;超级用户的只读模式

GRANT Select,Update,insert,create ON *.* TO root@"%" IDENTIFIED BY "123456";
授与root远程用户选择,更新,插入,创建权限;

 

文件加I锁

chattr +i /etc/passwd

查看方法:lsattr /etc/passwd,撤销为chattr –i /etc/group

 

posted @ 2018-10-18 15:43  木子巫  阅读(167)  评论(0编辑  收藏  举报