Home:ALL Converter>psql: could not connect to server on Linux

psql: could not connect to server on Linux

Ask Time:2017-01-21T12:36:54         Author:gvd

Json Formatter

I installed PostgreSQL on Linux, how is indicated in Debian Wiki

After installation I run the following commands:

# su - postgres
$ psql

And I got the following error:

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"?

I found I solutions, but for Mac

Postgres could not connect to server https://dba.stackexchange.com/questions/75214/psql-could-not-connect-to-server-no-such-file-or-directory

How can I solve this issue in Linux?

Distribution details:

Distributor ID : Debian
Description    : Debian GNU/Linux 8.7 (jessie)
Release        : 8.7
Codename       : jessie

PostgreSQL     : 9.4

Author:gvd,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41775788/psql-could-not-connect-to-server-on-linux
yy