January 2019
Intermediate to advanced
286 pages
7h 41m
English
If you want to see the roles assigned to a user, use the SHOW GRANTS statement as follows:
mysql> SHOW GRANTS FOR 'user_dev@localhost';
It will display the roles and usage granted to the user: user_dev. The following is the sample output:
+--------------------------------------------------+| Grants for user_dev@localhost@% |+--------------------------------------------------+| GRANT USAGE ON *.* TO `user_dev@localhost`@`%` || GRANT `user_dev`@`%` TO `user_dev@localhost`@`%` |+--------------------------------------------------+
This output specifies that it has usage granted on all the tables of all the databases (*.*).
The second row provides the name of the role assigned/granted to the user. So ...