Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos Postgres:无法连接到域套接字_Macos_Postgresql_Sockets_Homebrew - Fatal编程技术网

Macos Postgres:无法连接到域套接字

Macos Postgres:无法连接到域套接字,macos,postgresql,sockets,homebrew,Macos,Postgresql,Sockets,Homebrew,运行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"? 我使用自制软件安装了Postgres 9.3.3 哪个psql给出了/usr/local/bin/psql 这似乎是一个普遍的问

运行
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"?
我使用自制软件安装了Postgres 9.3.3

哪个psql
给出了
/usr/local/bin/psql

这似乎是一个普遍的问题。我非常抱歉再次询问,但我在这里至少经历了十几次问答,无法解决这个问题。我看过的一些帖子包括:

非常感谢,,
Justin

您是否修改了
postgresql.conf
以接受传入的TCP/IP连接?您应该取消注释
listen\u addresses
参数,并将其设置为适当的子网掩码。然后,在
pg_hba.conf
中,您必须添加一行以启用通过TCP/IP连接到数据库。这两个配置文件都在您的数据目录中(不知道它在OSX上的什么位置)。

谢谢。你能提供一些关于如何确定合适的子网掩码的指导吗?你应该查看你的网络配置(正如你可能已经注意到的,我对OSX不是很熟悉,所以无法帮助你了解细节)。您的ip地址可能以192.168.0开始,然后是第四个数字;这对于使用DHCP的路由器后面的自动网络配置是典型的(10.0.0.*是另一种不太常见的可能性)。还应具有255.255.*.*形式的子网掩码;第三个数字通常也是255,第四个数字通常是0。那是你的面具。如果数字确实不同,请咨询网络管理员。