mysql -e "SELECT user, host FROM mysql.user;"

Category: Databases & SQL

mysql -e "SELECT user, host FROM mysql.user;"

List MySQL user accounts

mysql.user is the system table holding accounts; host is part of the account identity, so 'alice'@'localhost' and 'alice'@'%' are different users. Related: SHOW GRANTS FOR to inspect privileges.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.