MySQL show users – how to show the users in a MySQL database
To show/list the users in a MySQL database, first log into your MySQL server as an administrative user, then run this MySQL query:
select * from mysql.user;
This MySQL query shows a large listing of MySQL user information, including user permission information, so you may want to trim down some of the fields to display. You can get a listing of the fields in the mysql.user
table by running this command:
desc mysql.user;