All Products
Search
Document Center

SHOW GRANTS

Last Updated: Jun 18, 2021

Description

You can execute the SHOW GRANTS statement to view user permissions as a system administrator.

Syntax

SHOW GRANTS [FOR username];

Parameters

Parameter

Description

FOR username

If you do not specify the username, this statement returns the permissions that have been granted to the current user. You can view the permissions of the current user.

To view the permissions of another specified user, ensure you have the SELECT permission on the mysql.user table.

Examples

View the permissions of the obsqluser01 user.

oceanBase(admin@TEST)>show grants for obsqluser01;
+-------------------------------------+
| Grants for obsqluser01@%            |
+-------------------------------------+
| GRANT USAGE ON *. * TO 'obsqluser01' |
+-------------------------------------+
1 row in set (0.02 sec)