#### 13.7.7.12 SHOW CREATE USER Statement

[]()

```
SHOW CREATE USER user
```

 This statement shows the [`CREATE USER`](create-user.html) statement that creates the named user. An error occurs if the user does not exist. The statement requires the [`SELECT`](privileges-provided.html#priv_select) privilege for the `mysql` system schema, except to see information for the current user. For the current user, the [`SELECT`](privileges-provided.html#priv_select) privilege for the `mysql.user` system table is required for display of the password hash in the `IDENTIFIED AS` clause; otherwise, the hash displays as `<secret>`.

 To name the account, use the format described in [Section 6.2.4, “Specifying Account Names”](account-names.html). The host name part of the account name, if omitted, defaults to `'%'`. It is also possible to specify [`CURRENT_USER`](information-functions.html#function_current-user) or [`CURRENT_USER()`](information-functions.html#function_current-user) to refer to the account associated with the current session.

 Password hash values displayed in the `IDENTIFIED WITH` clause of output from [`SHOW CREATE USER`](show-create-user.html) may contain unprintable characters that have adverse effects on terminal displays and in other environments. Enabling the [`print_identified_with_as_hex`](server-system-variables.html#sysvar_print_identified_with_as_hex) system variable (available as of MySQL 8.0.17) causes [`SHOW CREATE USER`](show-create-user.html) to display such hash values as hexadecimal strings rather than as regular string literals. Hash values that do not contain unprintable characters still display as regular string literals, even with this variable enabled.

```
mysql> CREATE USER 'u1'@'localhost' IDENTIFIED BY 'secret';
mysql> SET print_identified_with_as_hex = ON;
mysql> SHOW CREATE USER 'u1'@'localhost'\G
*************************** 1. row ***************************
CREATE USER for u1@localhost: CREATE USER `u1`@`localhost`
IDENTIFIED WITH 'caching_sha2_password'
AS 0x244124303035240C7745603626313D613C4C10633E0A104B1E14135A544A7871567245614F4872344643546336546F624F6C7861326932752F45622F4F473273597557627139
REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK
PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT
PASSWORD REQUIRE CURRENT DEFAULT
```

 To display the privileges granted to an account, use the [`SHOW GRANTS`](show-grants.html) statement. See [Section 13.7.7.21, “SHOW GRANTS Statement”](show-grants.html).

