You can use the ALTER USER or SET PASSWORD statement to change the password of a user.
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 UPDATE USER privilege, contact an administrator. For more information, see Modify user privileges.
SQL syntax:
obclient>ALTER USER username IDENTIFIED BY password;
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.
Syntax:
obclient> SET PASSWORD [FOR user] = PASSWORD('password');
Notes:
If the
FOR userclause is absent, 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 a specified user, you must have the globalCREATE USERprivilege.For information about how to view your privileges, see View user privileges. If you do not have the global
CREATE USERprivilege, contact an administrator. For more information, see Modify user privileges.
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.