Got the dreaded, only-macOs documented "No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432" but you are using wither Mint or Ubuntu?
Here's how to fix it.
-
verify the contents of /etc/postgresql/9.5/main/pg_hba.conf
-
if the file is empty, add this conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 0.0.0.0/32 md5
host all all 127.0.0.1/32 trust
host all all all trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
-
stop postgresql service with sudo /etc/init.d/postgresql stop
-
start postgresql service with sudo /etc/init.d/postgresql start
-
verify you can connect to the server with psql
This doesn't help me
I've made a symlink from
/var/run/postgresql/.s.PGSQL.5432
to tmp/tmp/.s.PGSQL.5432
that worked for a while.But now postgres isn't creating the file
/var/run/postgresql/.s.PGSQL.5432
so now I cant create the linkI've looked for the file .s.PGSQL.5432 with no success.
Any clues?
I must say that, I can connect using psql -U postgres, and cant connect a rails app (no passwords needed in order to access the locals DB)