I am running postgresql-9.6 on Rhel7. I know that the default/root user doesnt have a password, however i will like to use phpPgAdmin to do my work. the problem is I have edited my pg_hba.conf file to look as follow, (based on various documentation I have read so far:

local   all             all                          password
# IPv4 local connections:
host    all             all       password
# IPv6 local connections:
host    all             all             ::1/128      ident

The only problem is that after this configuration even the default user postgres has lost access completely. When I try to log in as the root user with psql and and enter my computer's root user's password this is what what happens:

-bash-4.2$ psql
psql: FATAL:  password authentication failed for user "postgres"

but when I change the above configuration on the pg_hba.conf file to:


I can log in as root however phpPgAdmin won't let me in without a password.

  • If you're using Docker. Try to check if your local DB is active because mostly it's conflicting with Docker, if so, you can deactivate it or uninstall it. Jan 7, 2020 at 15:20

2 Answers 2


I was in same situation. after installation on window machine I was getting below error:

C:\Users\xxxxx>psql -U postgres

psql: FATAL:  password authentication failed for user "postgres"
password retrieved from file "C:\Users\xxxxx\AppData\Roaming/postgresql/pgpass

To fix the above, I edited 'pgpass.conf' file with password I was using for the 'postgres' database, and it worked.


This error can provide from the fact that you installed actively another version of Postgres or passively within a system update (and you may not be aware in this case).

The consequence is that you try to connect to the current version of database that has changed (since install or update) and having in fact a port number that has changed. Therefore you may need to check this port number :

isogladiator@edubuntu:~$ sudo /etc/init.d/postgresql status
9.3/main (port **5432**): online
9.5/main (port **5434**): online
11/main (port **5433**): online

You may be using standard port 5432 while it has become 5433 for example.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.