Viewing a User's Privileges
The SHOW GRANTS command can be used to ascertain what privileges a user has. The output is a list of GRANT statements that can be used to reproduce the same permissions if you had to assign them to the user again. SHOW GRANTS FOR 'zak'@'localhost'; The result might look something like this: +----------------------------------------------+ | Grants for zak@localhost | +----------------------------------------------+ | GRANT USAGE ON zakdb.* TO 'zak'@'localhost' | | IDENTIFIED BY PASSWORD '57104f8717923cb5' | | GRANT SELECT, INSERT ON `sampdb`.`mytable` | | TO 'zak'@'localhost' | +----------------------------------------------+ Notice that this output indicates that a password has been set, but only an encrypted password is shown. You cannot decode this string back to the user's actual password. Issuing SHOW GRANTS with no FOR clause shows the privileges for the current user. It is equivalent to SHOW GRANTS FOR CURRENT_USER(); |