简体   繁体   English

Postgres:无法连接到域套接字

[英]Postgres: Unable to connect to domain socket

Running psql gets me this: 运行psql可以得到以下信息:

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. 我使用Homebrew安装了Postgres 9.3.3。

which psql gives /usr/local/bin/psql which psql给出了/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? 您是否修改了postgresql.conf以接受传入的TCP / IP连接? You should uncomment the listen_addresses parameter and set it to an appropriate subnet mask. 您应该取消注释listen_addresses参数并将其设置为适当的子网掩码。 Then in pg_hba.conf you have to add a line to enable connections to databases over TCP/IP. 然后,必须在pg_hba.conf中添加一行以启用通过TCP / IP的数据库连接。 Both configuration files are in your data directory (don't know where that is on OSX). 这两个配置文件都在您的数据目录中(不知道OSX上的位置)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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