How Do I Unlock an Account?
Symptom
Error message "The account has been locked" is reported when the cluster is connected.
Possible Causes
When you connect to a database in a cluster, if the number of consecutive incorrect password attempts reaches the upper limit, the account will be locked. The number of incorrect password attempts is specified by the GUC parameter failed_login_attempts, and the default value is 10.

You can view audit logs to locate the cause of account locking. For details, see Account Still Locked After Password Resetting.
Method for Unlocking the Administrator (dbadmin by Default)
You can log in to the GaussDB(DWS) management console to reset the administrator password. When the password is reset, the account is automatically unlocked. On the console, go to the Clusters page, locate the required cluster, and choose More > Reset Password.
Method for Unlocking Common Database Users
Connect to the database as the administrator (dbadmin by default) and run the following command to unlock a database user (replace user_name with the name of the locked user).
1 2 |
gsql -d gaussdb -p 8000 -U dbadmin -W Password -h Cluster IP address ALTER USER user_name ACCOUNT UNLOCK; |
Setting the Number of Times of Failed Login
You can set the maximum number of incorrect password attempts by configuring the failed_login_attempts parameter on the Parameter Modifications tab of the cluster. When failed_login_attempts is set to 0, the number of incorrect password attempts is unlimited. You are not advised to set failed_login_attempts to 0.
Perform the following steps:
- Log in to the GaussDB(DWS) console.
- Choose Dedicated Clusters > Clusters in the navigation pane.
- In the cluster list, find the target cluster and click the cluster name. The Cluster Information page is displayed.
- Click Parameter Modifications, find failed_login_attempts in the parameter list, and change its value. Click Save.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.