简体   繁体   中英

Postgres: Unable to connect to domain socket

Running psql gets me this:

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"?

I installed Postgres 9.3.3 using Homebrew.

which psql gives /usr/local/bin/psql

This seems to be a common issue. I'm terribly sorry to ask again, but I've gone through at least a dozen Q&As here and can't resolve the issue. A few posts I've gone through include:

Many thanks, Justin

Have you modified postgresql.conf to accept incoming TCP/IP connections? You should uncomment the listen_addresses parameter and set it to an appropriate subnet mask. Then in pg_hba.conf you have to add a line to enable connections to databases over TCP/IP. Both configuration files are in your data directory (don't know where that is on OSX).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM