In mysql CLI I did show databases; I then got a list of all DBs.

How could I list all users? show users; didn't work, and I didn't find a command here in a quick search.


From mysql prompt list only users

mysql> SELECT user FROM mysql.user; 

list users and hosts

mysql> SELECT user, host FROM mysql.user;

Likely you're looking for...

mysql --defaults-extra-file=/etc/mysql/debian.cnf -e "SELECT User, Host, Password FROM mysql.user;"

You system may use ~/.my.cnf or you may require passing -u + -p.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.