Skip to content

Instantly share code, notes, and snippets.

@okabe-yuya
Last active May 7, 2020 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okabe-yuya/7712695ae610150b04a0cd9ea6f3ff2e to your computer and use it in GitHub Desktop.
Save okabe-yuya/7712695ae610150b04a0cd9ea6f3ff2e to your computer and use it in GitHub Desktop.

can't launch postgres

error message

psql -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 "/tmp/.s.PGSQL.5432"?

postgresがinstallされているか

$ psql -V psql (PostgreSQL) 11.4

postgresの再起動

$ brew services restart postgresql

自分はこれで治った。これでもダメな場合は以下のファイルを削除すると良い模様

$ rm /usr/local/var/postgrespostmaster.pid

ref

https://stackoverflow.com/questions/13573204/psql-could-not-connect-to-server-no-such-file-or-directory-mac-os-x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment