MySQL Show Grants for all Users

If you would like to know what privileges a given User has to a Database there is an implemented command that can help out – SHOW GRANT. This will list all the privileges to any database that a User has, the syntax is as follows:

The below command will list all grants that the currently logged in user has:

SHOW GRANTS

If you’re logged in as the root user you can also view any grants that other users have. You should first know the User and the Host that it’s assigned to, for this you can refer to our article about viewing users – Show MySQL Users.

BLACK FRIDAY 2022

The command is:

SHOW GRANTS FOR user@host

Experiment with different MySQL commands on our SSD VPS Hosting Plans or get full freedom by managing your own Dedicated Server at a very affordable price!

Useful MySQL Commands: