All pages
Powered by GitBook
1 of 1

Loading...

SHOW CREATE USER

View the CREATE USER statement. This statement returns the SQL required to recreate a user account with its authentication details.

Syntax

Description

Shows the CREATE USER statement that creates the given user. The statement requires the SELECT privilege for the mysql database, except for the current user. The statement for the current user is shown where no user is specified.

SHOW CREATE USER quotes identifiers according to the value of the system variable.

Examples

:

See Also

  • shows the GRANTS/PRIVILEGES for a user.

  • shows the privileges supported by MariaDB.

This page is licensed: CC BY-SA / Gnu FDL

SHOW CREATE USER [user-name]
CREATE USER
sql_quote_show_create
User Password Expiry
CREATE USER
ALTER USER
SHOW GRANTS
SHOW PRIVILEGES
CREATE USER foo4@test require cipher 'text' 
  issuer 'foo_issuer' subject 'foo_subject';

SHOW CREATE USER foo4@test\G
*************************** 1. row ***************************
CREATE USER 'foo4'@'test' 
  REQUIRE ISSUER 'foo_issuer' 
  SUBJECT 'foo_subject' 
  CIPHER 'text'
CREATE USER 'monty'@'localhost' PASSWORD EXPIRE INTERVAL 120 DAY;

SHOW CREATE USER 'monty'@'localhost';
+------------------------------------------------------------------+
| CREATE USER for monty@localhost                                  |
+------------------------------------------------------------------+
| CREATE USER 'monty'@'localhost' PASSWORD EXPIRE INTERVAL 120 DAY |
+------------------------------------------------------------------+