Skip to main content

SHOW CREATE USER

Description​

SHOW CREATE USER statement is used to display the creation statement of a user in a database system. It helps administrators manage accounts more effectively.

Syntax​

SHOW CREATE USER '<user_identity>'

Return Value​

ColumnDescription
User Identityspecified user identity
Create Stmtcreation statement of the specified user

Access Control Requirements​

Users executing this SQL command must have at least the following privileges:

PrivilegeObjectNotes
ADMIN_PRIVUser or RoleThis SHOW CREATE USER operation can only be performed by users or roles with ADMIN_PRIV permissions.

Examples​

To view the creation statement of a specified user.

SHOW CREATE USER '<user_identity>'
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| User Identity | Create Stmt |
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| xxxxxxx | CREATE USER 'xxxxxxx'@'%' IDENTIFIED BY *** PASSWORD_HISTORY DEFAULT PASSWORD_EXPIRE INTERVAL 864000 SECOND FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 86400 SECOND COMMENT "" |
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+