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, the password of the current user is modified. Any successfully logged-in user can modify the password of the current user. If the FOR user clause is specified, the password of the specified user is modified. To modify the password of the specified user, you must have the CREATE USER privilege in the MySQL database. |
| password | By default, the password is transmitted in plaintext and will be encoded in the kernel. |
Examples
Modify the password of the current user.
obclient> SET PASSWORD = PASSWORD('**1***'); Query OK, 0 rows affectedModify the password of the
sqluser01user.obclient> SET PASSWORD FOR sqluser01 = PASSWORD('**2***'); Query OK, 0 rows affected