isthmuses
isthmuses

Reputation: 1336

Postgres.app says "Running on Port 5432" but psql command fails

I installed Postgres.app, and when I open it, the menu bar icon says "Running on Port 5432". But when I click on the "Open psql" menu option, I see the following message:

/Applications/Postgres.app/Contents/MacOS/bin/psql ; exit;
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"?
logout

[Process completed]

Any ideas what might be up?

Upvotes: 0

Views: 2106

Answers (2)

Cody Caughlan
Cody Caughlan

Reputation: 32758

According to:

http://postgresapp.com/documentation

Try connecting on the command line with:

$ psql -h localhost

Upvotes: 1

Wolph
Wolph

Reputation: 80101

It is most likely in a different location, there are a few ways to fix this.

  1. When connecting use tcp instead of unix sockets (-h localhost)
  2. Specify the correct socket while connecting (you can get it with: netstat -ln | grep PGSQL)
  3. Change the location of the socket by modifying your postgresql.conf and changing the unix_socket_directory variable.

Upvotes: 2

Related Questions