连接到基于 Windows 的 Postgresql 的问题

Eva*_*oky 8 postgresql windows

其他计算机甚至无法在我的 Windows 7 机器上找到正在运行的 Postgresql 9.1。本地连接当然工作得很好。

在我的 pg_hba.conf 我有:

#office subnets
host    all             all             192.168.##.0/24            md5
host    all             all             192.168.##.0/24            md5
Run Code Online (Sandbox Code Playgroud)

在 postgresql.conf 我有(是的,端口 5433 是故意的):

listen_addresses = '*'      # what IP address(es) to listen on;
                # comma-separated list of addresses;
                # defaults to 'localhost', '*' = all
                # (change requires restart)
port = 5433             # (change requires restart)
Run Code Online (Sandbox Code Playgroud)

netstat -a -bcmd 中运行后,我发现:

 Can not obtain ownership information
   TCP    0.0.0.0:5433           XXXXX-PC:0           LISTENING
Run Code Online (Sandbox Code Playgroud)

哎呀,我什至做了一个防火墙例外:

Protocols and Ports:
   Local port: Specific Ports, 5433
   Remote port:  All Ports
Scope: Any IP Address
Advanced: Profiles: Private, Public
Programs and Services:  Apply to this service:  postgresql-x64-9.1
Run Code Online (Sandbox Code Playgroud)

pgAdmin 的典型响应总是令人恐惧:

Server doesn't listen

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "...." and accepting TCP/IP connections on port 5433?
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

Chr*_*ers 5

以下是我建议的故障排除步骤:

  1. 从本地计算机尝试以下操作。如果它们有效,您就知道问题不在于 PostgreSQL。如果它们不起作用,那么您就知道问题出在机器本地。

    • psql -h 本地主机 -p 5433
    • psql -h [外部IP] -p 5433
    • 如果后者失败,请尝试暂时禁用所有防火墙并重试
  2. 如果可行,下一步就是排除网络故障。Traceroute 在这里可能会有所帮助。还可以尝试使用其他软件连接到任何其他开放端口,并确保其正常工作。从那里,您也许能够准确地找出数据包被丢弃的位置。

  • 在 cmd 中,它显示“'psql' 无法被识别为内部或外部命令。” (2认同)