【发布时间】:2012-10-30 15:33:24
【问题描述】:
我已经在我的 Mac 上安装了Postgres App 并且正在运行一个数据库。
我可以使用命令psql -h localhost从终端连接它
现在我想从同一网络上的另一台机器访问此服务器。
当我从另一台机器上做psql -h <hostname> -U <username> 时,我得到了错误
psql: could not connect to server: Connection refused
Is the server running on host "my hostname" (xx.xx.xx.xxx) and accepting
TCP/IP connections on port 5432?
在运行服务器的机器上我做了lsof -i | grep LISTEN,我得到了以下结果。
postgres 3196 sudarm 5u IPv6 0x1caf6120 0t0 TCP localhost:5432 (LISTEN)
postgres 3196 sudarm 6u IPv4 0x14678db0 0t0 TCP localhost:5432 (LISTEN)
postgres 3196 sudarm 7u IPv6 0x1caf6a80 0t0 TCP localhost:5432 (LISTEN)
我是否需要做任何其他事情才能从另一台机器连接到服务器?
【问题讨论】:
标签: macos postgresql