All Products
Search
Document Center

SET PASSWORD

Last Updated: Jun 18, 2021

Description

This statement changes the password of the current logon user or other users of ApsaraDB for OceanBase.

Syntax

SET PASSWORD [FOR user] = PASSWORD(password);
ALTER USER user IDENTIFIED BY password;

password:
  STR_VALUE

Parameter description

Parameter

Description

FOR user

If you do not specify the FOR user clause, the system changes the password for the current user. A user who logs on to ApsaraDB for OceanBase can change the password.

If you specify the FOR user clause, the system changes the password for the specified user. To change the password for a specified user, you must have the CREATE USER system permission.

Examples

  • Run the following command to change the password for the sqluser user to abc123:

oceanBase(admin@TEST)>SET PASSWORD for sqluser = PASSWORD(abc123);
Query OK, 0 rows affected (0.02 sec)