How to Fix ' FATAL: password authentication failed for user 'postgres' ' in PostgreSQL or pgAdmin4

preview_player
Показать описание
Are you encountering the "FATAL: password authentication failed for user 'postgres'" error when trying to connect to Postgres or pgAdmin? This error typically occurs when the provided password for the 'postgres' user is incorrect or authentication is not properly configured. Here's a step-by-step guide on how to fix this error:

1. Verify the Correct Password:
- Double-check the password you are using for the 'postgres' user. Ensure it is entered correctly, including any uppercase or lowercase letters.

2. Check Authentication Method:
- Look for the line that controls the authentication method for the 'postgres' user.
- By default, it may look like this: `local all postgres peer`.
- Change the authentication method to `md5`, like this: `local all postgres md5`.
- Save the file and restart the PostgreSQL service.

3. Restart PostgreSQL Service:
- Restart the PostgreSQL service to apply the changes you made to the configuration file.
- The method to restart the service depends on your operating system. Here are a few examples:
- On Linux: `sudo service postgresql restart`
- On Windows: Use the Services application to restart the PostgreSQL service.

4. Try Connecting Again:
- Launch pgAdmin or attempt to connect to PostgreSQL again using the 'postgres' user and the correct password.
- Make sure to provide the updated password if you changed it in the previous steps.

Following these steps should resolve the "FATAL: password authentication failed for user 'postgres'" error and allow you to connect to PostgreSQL or pgAdmin using the correct credentials.
Рекомендации по теме
Комментарии
Автор

THANK YOU. I just upgraded my postgres, something I hadn't bothered with in years. I felt like a completely lost newbie, and then... there you were! ;-)

malikrumi
Автор

Thank you, bro! And a few words to support the channel.

rustamsai
Автор

This is the only solution that worked. Thanks a lot!

wnshehn
Автор

Am using command prompt . Will the first 2 commands works if postgresql installed from the back end

vykuntaraotangudu
Автор

GENIUS! AWESOME. Thank you very much!!!!

mathecas
Автор

Amazing! Thank You for the video, struggled for some time before watching this, and it fixed instantly

SrikanthDongala-ziks
Автор

You're a lifesaver thanks brother

milesabuv
Автор

Thank you for this. I was googling solutions and kept coming up with junk.

AleksandrStrizhevskiy
Автор

tenkiu, no hablo ingles pero lo entendi todo claritamente. y me funciono. Gracias

Diegoneitor
Автор

ERROR: role "postgres_new" does not exist

still same error

omshreepal