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

Joined:
04/07/2009
Posts:
178

July 09, 2010 21:24:22    Last update: October 13, 2013 09:29:08
To resolve the error:
[focus@bamboo ~]$ psql -U postgres -W
Password for user postgres: 
psql: FATAL:  Ident authentication failed for user "postgres"


Edit /var/lib/pgsql/data/pg_hba.conf, change ident to trust, then restart postgres:
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust

# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
host    all         all         105.52.84.50/32       trust

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


Update: For version 9.1 on Ubuntu, the file is /etc/postgresql/9.1/main/pg_hba.conf, trust is changed to md5.
Share |
| Comment  | Tags