Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 2.34 KB

sql-statement-show-create-user.md

File metadata and controls

56 lines (40 loc) · 2.34 KB
title summary aliases
SHOW CREATE USER | TiDB SQL Statement Reference
An overview of the usage of SHOW CREATE USER for the TiDB database.
/docs/dev/sql-statements/sql-statement-show-create-user/
/docs/dev/reference/sql/statements/show-create-user/

SHOW CREATE USER

This statement shows how to re-create a user using the CREATE USER syntax.

Synopsis

ShowCreateUserStmt ::=
    "SHOW" "CREATE" "USER" (Username ("@" Hostname)? | "CURRENT_USER" ( "(" ")" )? )

Examples

mysql> SHOW CREATE USER 'root';
+--------------------------------------------------------------------------------------------------------------------------+
| CREATE USER for root@%                                                                                                   |
+--------------------------------------------------------------------------------------------------------------------------+
| CREATE USER 'root'@'%' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
+--------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> SHOW GRANTS FOR 'root';
+-------------------------------------------+
| Grants for root@%                         |
+-------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' |
+-------------------------------------------+
1 row in set (0.00 sec)

MySQL compatibility

  • The output of SHOW CREATE USER is designed to match MySQL, but several of the CREATE options are not yet supported by TiDB. Not yet supported options will be parsed but ignored. See Security compatibility for more details.
  • The output of SHOW CREATE USER is designed to match MySQL, but several of the CREATE options are not yet supported by TiDB. Not yet supported options will be parsed but ignored. See Security compatibility for more details.

See also