How to see/get a list of MySQL/MariaDB users accounts

You can see a list of MySQL/MariaDB user accounts by using the mysql client and querying the mysql.user table. The mysql.user table contains information about the user accounts, including the username, host, and authentication information.

Here’s how you can get a list of MySQL/MariaDB user accounts:

  1. Log in to the MySQL/MariaDB client:
    mysql -u root -p
  2. Select the mysql database:
    use mysql;
  3. Run the following query to get a list of user accounts:
    SELECT User, Host FROM user;

This will produce a list of the usernames and hostnames of all MySQL/MariaDB user accounts.

Note: Make sure to replace the root username with the appropriate MySQL/MariaDB username, and to enter the password when prompted.

Leave a Comment