SET-PASSWORD
SET PASSWORD
Description
Used to modify the login password of a user.
SET PASSWORD [FOR "user_identity"] =
[PASSWORD('plain password')]|['hashed password']-
"user_identity"If not specified, then modify the password of current user.
Note the
user_identityhere must completely match with theuser_identityspecified when creating user by usingCREATE USER, otherwise error will be reported that the user does not exist. If theuser_identityis not specified, the current user is'username'@'ip'. And the current user may not match with anyuser_identity. Theuser_identitycorresponding to current user can be viewed by command:select current_user(); -
PASSWORDThe password input by
PASSWOPD()is cleartext.And the password that uses character string directly and should be transferred is encrypted password.
To modify the password of other uses, the priviledge of admin is required.
Example
-
Modify the password of current user
SET PASSWORD = PASSWORD('123456'); SET PASSWORD = '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9'; -
Modify the password of specified user
SET PASSWORD FOR 'jack'@'192.%' = PASSWORD('123456'); SET PASSWORD FOR 'jack'@['domain'] = '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9';
Keywords
SET, PASSWORD