SHOW ROLES

Description

Displays all roles in the system. You can use SHOW GRANTS FOR ROLE <role_name>; to view the privileges of a specific role. For more information, see SHOW GRANTS.

NOTE

Only the user_admin role can execute this statement.

Syntax

SHOW ROLES

Return fields:

FieldDescription
NameThe name of the role.

Examples

Display all roles in the system.

mysql> SHOW ROLES;
+---------------+
| Name          |
+---------------+
| root          |
| db_admin      |
| cluster_admin |
| user_admin    |
| public        |
| testrole      |
+---------------+

References