【发布时间】:2015-06-21 07:59:25
【问题描述】:
我正在尝试设置 Postgres 服务器,我需要它能够接受远程连接。
当我从客户端建立远程连接时,我不断出现此错误:
Connection to 192.168.1.6:5432 refused.
Check that the hostname and port are correct and that the postmaster is accepting TCP/IP
我已经用这些行编辑了文件pg_hba.conf:
host all all 0.0.0.0/0 md5
和
host all all ::/0 md5
为了接受每个远程连接。
我还编辑了文件postgresql.conf,将监听地址设置为*。
我该如何解决这个问题?
【问题讨论】:
-
错误消息指示
Check that the hostname and port are correct。你是否?您的 Postgres 实例是否使用端口 5432? (SHOW port;) 客户端是否在同一个网络中? (192.168.1.6是一个 LAN 地址,从 Internet 上看不到,我想您知道吗?)您是否在更改为postgresql.conf后重新加载?如果问题仍然存在,请发布完整的pg_hba.conf文件(不带引号部分)。
标签: postgresql database-connection postgresql-9.4