Hi,
How can I show user's privileges in MySQL?
I want to know what is accessible to user in MySQL database. How to check this?
Thanks
Hi,
To view grant for a user you can use following sql query:
show grants for username;
Here is simple usage:
mysql> show grants for webservice; +-----------------------------------------------------------------------------------------------------------+ | Grants for webservice@% | +-----------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'webservice'@'%' IDENTIFIED BY PASSWORD 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | | GRANT ALL PRIVILEGES ON `mydb`.* TO 'webservice'@'%' | +-----------------------------------------------------------------------------------------------------------+ 2 rows in set (0.00 sec) mysql>
Thanks
Ads