Symptoms
-
The PostgreSQL port was changed from the default 5432 to a custom one in
/var/lib/pgsql/data/postgresql.conf
file. -
In an attempt to add the PostgreSQL database server in Plesk > Tools & Settings > Database Servers > Add Database Server, the following error is shown:
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Cause
This is the Plesk bug with ID #PPPM-10863 which will be fixed in the next Plesk update releases.
Resolution
Until the bug will be fixed, apply the following workaround:
-
Log into the server via SSH.
-
Using the vi text editor open the
/var/lib/pgsql/data/pg_hba.conf
file and change the authentication method for 127.0.0.1 fromident
tomd5
the result should be as below:# IPv4 local connections:
host all all 127.0.0.1/32 md5 -
Restart the PostgreSQL service:
# service postgresql restart
-
Try to add the PostgreSQL database server in Plesk > Tools & Settings > Database Servers > Add Database Server by setting Host name or IP address as 127.0.0.1