Skip to main content
Version: Stable-3.1

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.

This command is supported from v3.0.

tip

Only users with the user_admin role has the privilege to perform this operation.

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