-1

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 127.0.0.1/32 password

# IPv6 local connections:

host all all ::1/128 ident

The only problem is that after this configuration even the defaul user #postgreshas completly lost access, when i try to log in as the root user with psql and and enter my computer's root user's passwordthis is this is what is what happens:

-bash-4.2$ psql Password: psql: FATAL: password authentication failed for user "postgres" but when i change the above configuration on the pg_hba.conf file to:

peer

ident

ident

i can log in as root however phpPgAdmin won't let me in witouth a password. It's been 48 hours of headach. Your help is very much appricicated.

0

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
.conf"

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

  • I can't find this file it in pgsql 12 on Windows 10 – IggyPass Nov 22 at 11:34
0

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, privacy policy and cookie policy

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