Baidu AI Cloud
中国站

百度智能云

All Product Document

          Data Warehouse

          SET-PASSWORD

          SET PASSWORD

          Description

          Used to modify the login password of a user.

          SET PASSWORD [FOR "user_identity"] = 
          [PASSWORD('plain password')]|['hashed password']
          • "user_identity"

            If not specified, then modify the password of current user.

            Note the user_identity here must completely match with the user_identity specified when creating user by using CREATE USER , otherwise error will be reported that the user does not exist. If the user_identity is not specified, the current user is 'username'@'ip'. And the current user may not match with any user_identity. The user_identity corresponding to current user can be viewed by command:

            select current_user();
          • PASSWORD

            The password input byPASSWOPD() is cleartext.

            And the password that uses character string directly and should be transferred is encrypted password.

          To modify the password of other uses, the priviledge of admin is required.

          Example

          1. Modify the password of current user ​

            SET PASSWORD = PASSWORD('123456');
            
            SET PASSWORD = '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9';
          2. Modify the password of specified user

            SET PASSWORD FOR 'jack'@'192.%' = PASSWORD('123456');
            
            SET PASSWORD FOR 'jack'@['domain'] = '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9';

          Keywords

          SET, PASSWORD
          Previous
          SET-PROPERTY
          Next
          DROP-USER