简体   繁体   English

Windows拒绝postgres连接

[英]Windows refuses postgres connection

I have a local network connecting 15 PCs. 我有一个连接15台PC的局域网。 Every PC has postgres installed (8.3, 8.4, 9.2). 每台PC都安装了postgres(8.3、8.4、9.2)。 Every database has the exact same installation parameters as name, user, password, etc. 每个数据库都具有与名称,用户,密码等完全相同的安装参数。

I'm using a Java application, which implements JDBC library and I have been able to connect correctly to the databases in EVERY computer but one. 我正在使用Java应用程序,该应用程序实现了JDBC库,并且已经能够正确连接到每台计算机上的数据库,但只有一台。 I'm pretty sure I have set correctly the necesary parameters for pg_hba.conf and postgresql.conf, because they are set the same in all the 15 PCs. 我很确定我已经为pg_hba.conf和postgresql.conf正确设置了必要的参数,因为在所有15台PC上它们都设置了相同的参数。

I also have set the Windows Firewall exception for the port 5432 我还为端口5432设置了Windows防火墙例外

All this has lead me to conclude that the problem lies in that specific PC that doesn't accepts the connection. 所有这些使我得出结论,问题出在那台不接受连接的特定PC上。 It has Windows 7 Ultimate installed, the same as the rest, and postgres 8.3. 它安装了Windows 7 Ultimate,与其余版本相同,并安装了postgres 8.3。

This is the error that i get: org.postgresql.util.PSQLException: Connection attempt timed out. 这是我得到的错误:org.postgresql.util.PSQLException:连接尝试超时。

I don't want to format the PC from zero 我不想从零开始格式化PC

Can someone help me with this? 有人可以帮我弄这个吗?

Well, now I know how to solve the problem with a not very orthodox solution. 好吧,现在我知道如何用不是很正统的解决方案解决问题了。 When this happens, we just copy the pg_hba.conf from a working PC and this solves the problem. 发生这种情况时,我们只需从工作的PC复制pg_hba.conf即可解决此问题。 I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM