MySQL SHOW USERS? – How to List All MySQL Users and Privileges

Expert User Verified
You can get a list of MySQL user accounts and what type of privilege is associated with the user by querying the mysql.users table.
SELECT * FROM mysql.user;

You can get a list of users by running a simple select statement against the mysql.user table.

On my test system, this returns 5 records. 

SELECT user, host FROM mysql.user;
+------+-----------+
| user | host      |
+------+-----------+
| localhost | {3a76cbff1b5ce5ace3bd34bbdd68f71285d81fb9af60114c7a6db80d3a8688de}         |
| root | {3a76cbff1b5ce5ace3bd34bbdd68f71285d81fb9af60114c7a6db80d3a8688de}         |
| 127.0.0.1 | localhost |
| ::1 | localhost |
| localhost | pma |
+------+-----------+
5 rows in set (0.1547 sec)

References and Credits

Comments

Leave a Comment