What do I do if the error:password authentication failed for user "test****" error is returned?

更新时间:
复制 MD 格式

This error occurs when you connect to an AnalyticDB for PostgreSQL instance with an incorrect password. First, re-enter the password. If the error persists, reset the password using one of the methods below.

The console method resets the password for the initial account only. To reset the password for a standard account, use SQL or the API.

Problem description

When you use a client to connect to an AnalyticDB for PostgreSQL instance, the error:password authentication failed for user "test****" error is returned.

Cause

You entered an incorrect password for the database account.

Solution

Console

  1. Log on to the AnalyticDB for PostgreSQL console. In the upper-left corner, select a region. Find the instance and click the instance ID.

  2. In the left-side navigation pane, click Account Management.

  3. Find the database account, then click Reset Password in the Actions column. Enter the new password in the dialog box that appears.

SQL

Run the following statement to reset the password:

ALTER ROLE username WITH PASSWORD 'userPassword';

For the complete syntax, see ALTER ROLE.

API

Call the ResetAccountPassword operation to reset the password of a database account.