0

I have a server with postgreSQL running. A few days ago I set it up so that I can access the database remotely from my home PC and that worked (based on this guide: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html). Now I noticed that for whatever reason, I can not access the database via localhost or 127.0.0.1.

psql mydatabase works without any problem. psql -h myDomain.net mydatabase also works. psql -h localhost mydatabase tells me

psql: FATAL: Ident authentication failed for user "smaug"

I tried reverting the changes that I made earlier to get remote access to the DB to no avail.

What could be the cause of this problem?

Luxalpa
  • 119
  • 4

2 Answers2

1

ok I found out the problem. Going to the file /var/lib/pgsql/data/pg_hba.conf, looking for the line

host all all 127.0.0.1/32 ident

and replacing ident with trust apparently fixed the issue.

Luxalpa
  • 119
  • 4
1

You should add host all all 127.0.0.1/32 md5 to your pg_hba.conf and reload PostgreSQL service then.

Alex
  • 7,939
  • 6
  • 38
  • 52