When connecting to PostgreSQL, I get an "Authentication Failed" error.

psql: FATAL:  password authentication failed for user "your_username"

An Authentication Failed error occurs when:

  • You connect to the wrong database cluster.
  • You use the wrong username or password.

If you are getting this error, check the cluster and username/password combination you’re using. To better review changes, we recommend the flags format to modify the connection string. For more on the flags format, see How To Connect to PostgreSQL.

Verify that the hostname is correct and whether your local machine has DNS resolution problems.
Verify that the hostname is correct and that you’ve created the database.
Verify your connection string and add your local machine to the database cluster’s trusted sources.