Bootstrap FreeKB - mySQL / MariaDB - List users using the SELECT USERS statement
mySQL / MariaDB - List users using the SELECT USERS statement

Updated:   |  mySQL / MariaDB articles

This assume you are able to log into your MariaDB or mySQL server .The user table in the mysql database your mysql users. You can display the users in the mysql user table like this.

mysql -u root --password=itsasecret "use mysql; select * from user \G"


Or, if you have configured passwordless authentication the -e command line option can be used.

mysql -e "use mysql; select * from user \G"


Or like this.

mysql -e "select * from mysql.user \G"


Something like this should be returned for each user.

                  Host: %
                  User: john.doe
              Password: *B87A204DF7CFB2D1ABC123456JFH0DC081CD35EF2
           Select_priv: Y
           Insert_priv: Y
           Update_priv: Y
           Delete_priv: Y
           Create_priv: Y
             Drop_priv: Y
           Reload_priv: N
         Shutdown_priv: N
          Process_priv: N
             File_priv: N
            Grant_priv: Y
       References_priv: N
            Index_priv: N
            Alter_priv: Y
          Show_db_priv: N
            Super_priv: N
 Create_tmp_table_priv: N
      Lock_tables_priv: N
          Execute_priv: N
       Repl_slave_priv: N
      Repl_client_priv: N
      Create_view_priv: N
        Show_view_priv: N
   Create_routine_priv: N
    Alter_routine_priv: N
      Create_user_priv: N
            Event_priv: N
          Trigger_priv: N
Create_tablespace_priv: N
         max_questions: 0
           max_updates: 0
       max_connections: 0
  max_user_connections: 0



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

Please enter cf4c3e in the box below so that we can be sure you are a human.