Linux运维笔记
我们一直在努力

MySQL中查看grant授权与移除授权的方式

删除MySQL授权:
use mysql;
select User,Host,Password from user;
drop user ”@localhost;

5.7的Password改成了authentication_string

update mysql.user set password=PASSWORD(‘redhat’) where User=’root’

 

mysql> select distinct concat(‘User: ”’,user,”’@”’,host,”’;’) as ‘MySQL Grant User List:’ from mysql.user;
+————————————+
| MySQL Grant User List:                 |
+————————————+
| User: ‘slave’@’118.184.218.214’;   |
| User: ‘bbsuser’@’118.184.218.223’; |
| User: ‘root’@’172.19.74.197’;        |
| User: ‘bbsuser’@’172.19.24.187’;  |
| User: ‘bbsuser’@’172.19.24.188’;  |
| User: ‘mysql.sys’@’localhost’;       |
| User: ‘root’@’localhost’; |
| User: ‘testuser’@’localhost’; |
| User: ‘datauser’@’localhost’; |
| User: ‘gustuser’@’localhost’; |
+————————————+
10 rows in set (0.00 sec)

 

占位!未完待续

赞(0) 打赏

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址