606

I have installed PostgreSQL 8.4, Postgres client and Pgadmin 3. Authentication failed for user "postgres" for both console client and Pgadmin. I have typed user as "postgres" and password "postgres", because it worked before. But now authentication is failed. I did it before a couple of times without this problem. What should I do? And what happens?

psql -U postgres -h localhost -W
Password for user postgres: 
psql: FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"
5
  • 6
    In my case the connection fails because the password is too complex ... Commented Feb 18, 2015 at 17:21
  • 3
    Be sure to read all the way down this page. I had to do several things to get this working. First, the ALTER step, then editing my pg_hba.conf file, then restarting postgres. Commented Oct 28, 2015 at 19:52
  • Possible duplicate of How do I login and authenticate to Postgresql after a fresh install? Commented Apr 30, 2018 at 19:37
  • 5
    Also ensure that you have not two Postgres instances running: one on Windows, one in Docker. Docker did not report to me that the port was already taken. So, the tool connected to the Windows machine Postgres, whereas in the Docker postgers, everything was fine. Commented Sep 25, 2019 at 10:39
  • How is this a programming question? It may be system administration, but that's a separate discipline. Commented Feb 8, 2024 at 1:17

32 Answers 32

1
2
0

For me I was using .Net Aspire hosting, so docker, with a data volume and I had changed the password since the first time the container was created. So the solution was to delete the docker volume.

Sign up to request clarification or add additional context in comments.

Comments

-2

I hope this will help you short of time. You can change the password of postgres sql by using bellow command.

Command

sudo -u postgres psql

And next you can update the password

Command

Alter user postgres password 'YOUR_NEW_PASSWORD';

1 Comment

Your answer just contains information, that has already been added: stackoverflow.com/a/7696398/8283469
1
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.