SHOW CREATE USER

SHOW CREATE USER user

The SHOW CREATE USER statement returns the CREATE USER statement used to create the specified user. An error occurs if the user doesn’t exist.

The statement requires the SELECT privilege for the mysql system schema, except when you request information for the current user. For the current user, the SELECT privilege on the mysql.user system table is needed to show the password hash in the IDENTIFIED AS clause; otherwise, the hash appears as <secret>.

If the host part of the account name is omitted, it defaults to '%'. You can also specify CURRENT_USER or CURRENT_USER() to refer to the account associated with the current session.

For more information, see the MySQL documentation: SHOW CREATE USER Statement.