MySQL : Listing the system and object privileges for a given user

If your are connected as root on your MySQL database, you can list all the system and object privileges for a given user :

mysql> show grants for user ‘fool’@’localhost’;

or if you are connected as the user fool :

mysql> show grants;

mysql> show grants for current_user;

mysql> show grants for current_user();

current_user function is available if your MySQL version is equal or higher that 5.0

Advertisements

One thought on “MySQL : Listing the system and object privileges for a given user

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s