> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-user.md).

# SHOW CREATE USER

## Syntax

```bnf
SHOW CREATE USER [user-name]
```

## Description

Shows the [CREATE USER](/docs/server/reference/sql-statements/account-management-sql-statements/create-user.md) statement that creates the given user. The statement requires the [SELECT](/docs/server/reference/sql-statements/account-management-sql-statements/grant.md#table-privileges) privilege for the [mysql](/docs/server/reference/system-tables/the-mysql-database-tables.md) database, except for the current user. The [CREATE USER](/docs/server/reference/sql-statements/account-management-sql-statements/create-user.md) statement for the current user is shown where no user is specified.

`SHOW CREATE USER` quotes identifiers according to the value of the [sql\_quote\_show\_create](/docs/server/server-management/variables-and-modes/server-system-variables.md#sql_quote_show_create) system variable.

## Examples

```sql
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'
```

[User Password Expiry](/docs/server/security/user-account-management/user-password-expiry.md):

```sql
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 |
+------------------------------------------------------------------+
```

## See Also

* [CREATE USER](/docs/server/reference/sql-statements/account-management-sql-statements/create-user.md)
* [ALTER USER](/docs/server/reference/sql-statements/account-management-sql-statements/alter-user.md)
* [SHOW GRANTS](/docs/server/reference/sql-statements/administrative-sql-statements/show/show-grants.md) shows the `GRANTS/PRIVILEGES` for a user.
* [SHOW PRIVILEGES](/docs/server/reference/sql-statements/administrative-sql-statements/show/show-privileges.md) shows the privileges supported by MariaDB.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
