dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: Understanding What Grants a User Has in MySQL

Learn how to view what permissions a given user has been granted.


advertisement

MySQL allows various permissions to be set for users during (or after) creation. The following command comes handy to understand what GRANTS a user has.

Command: SHOW GRANTS FOR user;

In the above command, replace the user with the real username to know the GRANTS associated with the user.

Sample:

SHOW GRANTS FOR root; 

Results in:

+-------------------------------------------------------------+
| Grants for root@%                                 |
+-------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION |
+-------------------------------------------------------------+ 

 

Visit the DevX Tip Bank

 



   
Sridhar M S. is a Java developer from Bangalore, India. He holds a master's degree in Computer Science.
Thanks for your registration, follow us on our social networks to keep up-to-date