Skip to content

Instantly share code, notes, and snippets.

@tomas-stefano
Created January 4, 2013 12:39
Show Gist options
  • Save tomas-stefano/4452338 to your computer and use it in GitHub Desktop.
Save tomas-stefano/4452338 to your computer and use it in GitHub Desktop.
$ psql foo

psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

Some Dirty solutions

Change this:

unix_socket_directory = ''

To this:

unix_socket_directory = '/var/pgsql_socket/'

Create and change the owner of this dir, putting the owner of the postgres.

$ mkdir /var/pgsql_socket
$ chmod ....
$ chown ....

Then restart postgres:

$ pg_ctl -D /usr/local/var/postgres -l logfile stop
$ pg_ctl -D /usr/local/var/postgres -l logfile start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment