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

281 Views Asked by At

When I type 'psql' into terminal, or when I try to connect to the server using Postgres.app I get

"/Applications/Postgres.app/Contents/Versions/9.6/bin/psql" -p5432 -d "postgres"
psql: could not connect to server: No such file or directory".
Is the server running locally and accepting
connections on Unix domain socket "/Users/Dimitar/postgres/.s.PGSQL.5432"?

However, when I type "psql -p 5432 -h localhost", I successfully connect. Can someone please tell me why that is the case. I've looked everywhere online and most people with a similar issue cannot get "psql -p 5432 -h localhost" to work as it does for me.

Here are the processes that show up including the word "post"

Image

0

There are 0 best solutions below