51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

查看mysql用户拥有的权限

查看mysql数据库所有用户的权限

mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

+----------------------------+
| query |
+----------------------------+
| User: 'root'@'127.0.0.1'; |
| User: 'demo'@'127.0.0.1'; |
| User: 'root'@'::1'; |
| User: 'root'@'localhost'; |
+----------------------------+
4 rows in set (0.00 sec)

查看mysql数据库中某个用户的权限

mysql> show grants for 'demo'@'127.0.0.1';

+---------------------------------------------------------------------------------------------------------------+
| Grants for demo@127.0.0.1 |
+---------------------------------------------------------------------------------------------------------------+
| GRANT SELECT ON *.* TO 'demo'@'127.0.0.1' IDENTIFIED BY PASSWORD '*183D4A719E6666E5809CFEBC2664C5B7255DB14D' |
+---------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

赞(0)
未经允许不得转载:工具盒子 » 查看mysql用户拥有的权限