Symptoms
-
Unable to update PostgreSQL password via command line:
# plesk bin database-server –update-server localhost:5432 -type postgresql -passwd ‘<password>’
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket “/tmp/.s.PGSQL.5432”?
psql: FATAL: Ident authentication failed for user “postgres”
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket “/tmp/.s.PGSQL.5432”? -
It is not possible to log in to the PostgreSQL server:
# psql -Uadmin postgres
Password for user admin:
psql: FATAL: password authentication failed for user “postgres”
Cause
Incorrect authentication method (ident
) configured on PostgreSQL.
Resolution
-
Connect to the server via SSH.
-
Edit file
/var/lib/pgsql/data/pg_hba.conf
, replacingident
totrust
in the section beginning with “local”, as follows:# 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
# IPv6 local connections:
host all all ::1/128 trust -
In case the following line exists, remove it:
host all all 0.0.0.0/0 md5
-
Restart PostgreSQL server:
# service postgresql restart