Edit

SHOW GRANTS

Description

This statement is used to view user permissions.

Syntax:

SHOW [ALL] GRANTS [FOR user_identity];

Note:

1. SHOW ALL GRANTS can view the privileges of all users. 
2. When user_identity is specified, the permissions of the user thus specified will be showed. Meanwhile, this user_identity must be created through CREATE USER command. 
3. When user_identity is not specified, the permissions of the current user will be showed. 

Examples

  1. View all users' permissions.

    SHOW ALL GRANTS; 
  2. View specified users' permissions.

    SHOW GRANTS FOR jack@'%';
  3. View the current user's permissions.

    SHOW GRANTS;