devxlogo

Understanding What Grants a User Has in MySQL

Understanding What Grants a User Has in MySQL

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 |+-------------------------------------------------------------+ 
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist