2

I am trying to start the PostgreSQL database, but it's always failing.

Command I am trying: psql -h localhost -U postgres resulting error: psql: FATAL: Ident authentication failed for user "postgres".

Contents of /var/lib/pgsql/9.5/data/pg_hba.conf is as follows:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident

I recently made the change for the pg_hba.conf file, I am assuming I don't have to restart the postgres. I followed this solution but no help. Any suggestion on how to fix this?

Suthan Bala
  • 121
  • 1
  • 4
  • 1
    `peer` is the local version of `ident`. Both options expect that the user running the `psql` command is the same as the user you are trying to log in as. – DerfK Apr 18 '17 at 21:21

0 Answers0