Purpose
This statement is used to modify the password of the current login user or another user in OceanBase Database.
Syntax
SET PASSWORD [FOR user] = password_option
password_option: {
PASSWORD('authstring')
|'hashstring'
}
Parameters
| Parameter | Description |
|---|---|
| FOR user | If the FOR user clause is not specified, it indicates that the password of the current user will be modified. Any successfully logged-in user can modify the password of the current user. If the FOR user clause is specified, it indicates that the password of the specified user will be modified. You must have the CREATE USER privilege in the MySQL database to modify the password of the specified user. |
| password_option | The password option. You can use PASSWORD('authstring') to specify a plaintext password, which will be automatically encoded by the system. Alternatively, you can directly use 'hashstring' to specify an encrypted hash string. |
Examples
Modify the password of the current user.
obclient> SET PASSWORD = PASSWORD('**1***');Modify the password of the
sqluser01user.obclient> SET PASSWORD FOR sqluser01 = PASSWORD('**2***');
