Postgres远程连接

我遇到麻烦让postgres允许通过局域网的远程访问。 2个conf文件如下…

#postrges.conf # - Connection Settings - .200 is where the server's IP listen_addresses = '192.168.0.200,localhost' port = 5432 ... #pg_hba.conf # IPv4 local connections: host all all 127.0.0.1/32 md5 # allow LAN connections only... host all all 192.168.0.0/255 md5 

这里怎么了? postgres服务器甚至不会重新启动…

  # allow LAN connections only... host all all 192.168.0.0/255 md5 

尝试将其改为CIDR表示法

  # allow LAN connections only... host all all 192.168.0.0/32 md5 

尝试改变

 listen_addresses = '192.168.0.200,localhost' 

 listen_addresses = '*' 

关于不重新启动:检查您的postgres日志文件或在liux:/ var / log / syslog

如果postgres服务器正在重新启动,请检查它是否在所需的接口上运行

  netstat -tapn