Updated on 2026-11-06 GMT+08:00

Show Roles

Function

Displays all roles or display the roles bound to a specified user_name in the current database.

Syntax

SHOW [ALL] ROLES [user_name];

Parameters

ALL: Displays all roles.

Precautions

The ALL keyword and user_name cannot be used simultaneously.

Examples

  • Display all roles under the project.
    SHOW ALL ROLES;

    Only administrators have permission to execute the SHOW ALL ROLES statement.

  • Display all roles bound to the user named user_name1.
    SHOW ROLES user_name1;