Purpose
This statement is used to modify the password of the current login user or other users in OceanBase Database.
For other methods to modify user passwords, see ALTER USER.
Syntax
SET PASSWORD [FOR user_name] = PASSWORD(password);
password:
STR_VALUE
Parameters
| Parameter | Description |
|---|---|
| FOR | Indicates the password of the specified user is to be modified. It is an optional clause. You must have the ALTER USER system privilege to modify the password of the specified user. If the FOR clause is not specified, the password of the current user is to be modified. Any successfully logged-in user can modify the password of the current user. |
| user_name | The name of the user. |
| password | The new password of the user. |
Examples
Change the password of user user1 to **1***.
obclient> SET PASSWORD FOR user1 = PASSWORD(**1***);
Query OK, 0 rows affected
