psql: could not connect to server: No such file or directory

Solution Verified - Updated -

Issue

  • We are unable to login the PostgreSQL database of Jon server application using the command psql. Tried to login as postgres and root user, but getting the same error. Please see the error details below and guide us fix this error ASAP.
bash-4.3$ psql
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"?

Environment

  • Red Hat Enterprise Linux 6 (RHEL)
  • PostgreSQL database

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content