mySQL / MariaDB - display a users privileges using SELECT mysql.users

This assume you are able to log into your MariaDB or mySQL server or you have configured passwordless authentication and will be using the -e command line option. The SELECT statement can be used to view a users privileges.

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


Something like this should be returned. In this example, 'john.doe'@'localhost' only has the SELECT privilege.

                  Host: localhost
                  User: john.doe
              Password: *abc123
           Select_priv: Y
           Insert_priv: N
           Update_priv: N
           Delete_priv: N
           Create_priv: N
             Drop_priv: N
           Reload_priv: N
         Shutdown_priv: N
          Process_priv: N
             File_priv: N
            Grant_priv: N
       References_priv: N
            Index_priv: N
            Alter_priv: N
          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
   Delete_history_priv: N


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

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


Web design by yours truely - me, myself, and I   |   |