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

by
Jeremy Canfield |
Updated: November 01 2021
| mySQL / MariaDB articles
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
Did you find this article helpful?
If so, consider buying me a coffee over at