select user from mysql.db where db='DB_NAME'; code example Example: mysql list users on ubuntu SELECT User FROM mysql.user;