After a user is created, the administrator or the user can change the password.
Change the password of a user by using the ALTER USER statement
You can execute the ALTER USER statement to change the passwords of other users. To execute this statement, you must have the UPDATE USER privilege.
For information about how to view your privileges, see View user privileges. If you do not have the required privileges, contact the administrator to obtain the privileges. For more information, see Modify user privileges.
The syntax is as follows:
ALTER USER username IDENTIFIED BY password;
For example, change the password of sqluser01 to ******.
obclient> ALTER USER sqluser01 IDENTIFIED BY ******;
For more information about the ALTER USER statement, see ALTER USER.
Change the password of a user by using the SET PASSWORD statement
You can execute the SET PASSWORD statement to change your password or the passwords of other users.
The syntax is as follows:
SET PASSWORD [FOR user] = PASSWORD(password);
Some notes about this:
If the
FOR userclause is not specified, this statement changes the password of the current user. Any logged-on user can change their password.If the
FOR userclause is specified, this statement changes the password of the specified user. To change the password of the specified user, you must have theCREATE USERprivilege.For information about how to view your privileges, see View user privileges. If you do not have the required privileges, contact the administrator to obtain the privileges. For more information, see Modify user privileges.
For example, change the password of sqluser01 to ******.
obclient> SET PASSWORD for sqluser01 = PASSWORD(******);
Query OK, 0 rows affected
For more information about the SET PASSWORD statement, see SET PASSWORD.
Change the password of a user in the OCP console
You can change the password of a user in the OceanBase Cloud Platform (OCP) console.
Prerequisites
You have permissions of the TENANT_MANAGER role. Otherwise, request the OCP administrator to assign the role. For more information, see "Edit a user" in the OCP User Guide of the corresponding version.
Procedure
Log on to the OCP console.
In the left-side navigation pane, click Tenants to go to the Tenants page.
In the tenant list, find the target tenant to which the user belongs and click the tenant name. Then, the Overview page appears.
In the left-side navigation pane, click User Management.
In the user list, find the user whose password is to be changed. In the Actions column, click Change Password.

In the dialog box that appears, enter the new password and confirm it, and then click OK.