Purpose
This statement is used to change the password of the current logged-in user or another user in OceanBase AI 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 changed. Any successfully logged-in user can change their own password. If the FOR user clause is specified, the password of the specified user is changed. You must have the global (MySQL database) CREATE USER privilege to change the password of a specified user. |
| password_option | Password option. You can use PASSWORD('authstring') Specify the plaintext password, and the system will automatically encode it; you can also use 'hashstring' Specifies the encrypted hash string. |
Examples
Change the current user's password.
obclient> SET PASSWORD = PASSWORD('**1***');Change the password of the
sqluser01user.obclient> SET PASSWORD FOR sqluser01 = PASSWORD('**2***');