CREATE USER statement that reproduces a user, including its authentication method, default roles, account state, and properties.
The statement reflects the current state of the user. Changes made by ALTER USER or SET PASSWORD after the user was created are included.
Tip
All users can run this statement against themselves. Viewing another user requires the user_admin role or the GRANT privilege on SYSTEM.
The password digest is returned only to users that hold the SHOW SECRET privilege on SYSTEM. Otherwise it is masked as <secret>. This applies to your own user as well.
Syntax
Parameters
Output
Clauses are emitted only when they differ from the default:
Note
Two caveats apply to the emitted statement:
- User properties are stored per user name rather than per user identity.
'jack'@'192.168.%'and'jack'@'10.1.%'therefore return the samePROPERTIESclause. - If a password policy applies to the user, through either the
PASSWORD_POLICYproperty or a cluster-wide policy, the emitted statement cannot be replayed as it stands.IDENTIFIED WITH ... ASsupplies a password digest, and a password policy can only validate a plaintext password, soCREATE USERrejects it withBecause the Password Policy is in effect, you cannot use a hashed password.Recreate such a user with a plaintext password instead.