mysql

How to list of MySQL/MariaDB users accounts

Login to mysql

$ mysql -u root -p

 

Show users

mysql> SELECT User FROM mysql.user;

SELECT User FROM mysql.user;

Show users along with host name where they are allowed to login

mysql> SELECT host, user FROM mysql.user;

OR

mysql> SELECT CONCAT(QUOTE(user),'@',QUOTE(host)) UserAccount FROM mysql.user; OR mysql> SELECT host, user, password FROM mysql.user;

SELECT host, user FROM mysql.user;

 

Finding out user rights

mysql> SELECT User, Db, Host from mysql.db;