'Unable to connect with PostgreSQL with command line psql: error: connection to server at "localhost" (::1), port 5432 failed

I have been trying to connect with the newly created PostgreSQL database. But in the command line, it is showing

psql: error: connection to server at "localhost" (::1), port 5432 failed, FATAL: password authentication failed for user <user>

I am entering the right password but still having the issue



Solution 1:[1]

Solved this issue:

In my case entered username was incorrect.

I checked installation_summary.txt file to know the username.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1