3

有人可以帮忙看看这个奇怪的问题吗?我仍然无法远程连接到我的 Postgresql。

我的步骤:

  1. 下载最新的 Postgresql 并将其安装到我的本地计算机
  2. 设置 postgresql
  3. 创建数据库
  4. 修改“pg_hba”,添加行“host all all 0.0.0.0/0 md5”
  5. 修改“postgresql.conf”,确保“listen_addresses = '*'”
  6. 重启postgresql服务
  7. 打开本地 PgAdmin,并连接到 DB <-- 成功!
  8. 从远程桌面,执行与 #7 相同的操作 <-- 失败!

错误信息:

“服务器不听”“无法连接到服务器......接受端口 5432 上的 TCP/IP 连接?”

  • 当我输入“netstat -a”时,我发现“TCP 0.0.0.0:5432 Listening”
  • 我检查了防火墙,它没有启用......

有人可以帮忙吗?有人遇到这种情况吗?PS,我的操作系统是Winserver 2008

先谢谢了~

4

1 回答 1

1

If you're connecting to the local machine via RDP then you'll be connecting via localhost and no firewall or LAN/WAN/NAT settings should affect pgadmin.

When you edit the pg_hba and postgresql.conf files Server 2008 doesn't usually let you edit them directly where they are. I usually copy them out edit them and then paste them back in. You'll need to authorise the paste from an Admin account.

I usually have a separate rule in "pg_hba" with "host all all 127.0.0.1/32 md5" for local connections. Also ensure when you restart the service that it is running under the user "postgres" and not as some other user.

于 2013-06-11T23:51:27.733 回答