Purpose
This statement is used to modify the password of the current user or other users 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 modifying the password of the current user. Any successfully logged-in user can modify the password of the current user. If the FOR user clause is specified, it indicates modifying the password of the specified user. You must have the CREATE USER privilege on the global (MySQL) database to modify the password of the specified user. |
| 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