Mysql 查看所有用户

 #查看所有用户
select CONCAT('User:',user,'@',host) from mysql.user;

输出:


| CONCAT('User:',user,'@',host) |
+-------------------------------+
| User:adam@%                   |
| User:root@127.0.0.1           |
| User:root@::1                 |
| User:adam@localhost           |
| User:quan@localhost           |
| User:root@localhost           |
+-------------------------------+
6 rows in set (0.00 sec)


#查看用户权限

show grants for 'adam'@'localhost';

输出:

+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'adam'@'localhost' IDENTIFIED BY PASSWORD '*B2652B2C91E14A2B0088107BB28698EA57F78E01' |
| GRANT ALL PRIVILEGES ON `wujin`.* TO 'adam'@'localhost'                                                     |
+-------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Adam博客
请先登录后发表评论
  • 最新评论
  • 总共0条评论