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:
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.
The command is:
SHOW GRANTS FOR user@host
Useful MySQL Commands: