升级 Ubuntu 后 JDBC 到 PostgreSQL 不再工作
所以我让 PostgreSQL 使用 8.4(?) 在 Ubuntu 11.04 中工作,但是,当我升级它时,它也将 PostgreSQL 升级到 9.1,现在我无法使用 JDBC 连接。
我将以下内容添加到我的 pg_hba.conf 中
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
,并将以下内容添加到我的 postgres.conf 中...
listen_addresses = '*'
但我得到以下与 SQuirrel 连接
My Local PostgresSQL: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
有什么想法吗?
So I had PostgreSQL working in Ubuntu 11.04 using 8.4(?), however, when I upgraded it also upgraded PostgreSQL to 9.1 and now I can't connect using JDBC.
I added the following to my pg_hba.conf
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
and the following to my postgres.conf...
listen_addresses = '*'
but I get the following connecting with SQuirrel
My Local PostgresSQL: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据此网站,默认端口为
5432,但是,根据默认安装的
postgres.conf
文件,端口设置为5433
...因此,如果其他人遇到此问题,请尝试新端口。
我认为这与安装在看到现有的
8.4
时增加端口有关Per this site the default port is
5432
, however, per thepostgres.conf
file that came installed by default the port is set to5433
...So if someone else has this problem try the new port.
I think it has to do with the install incrementing the port when it sees the existing
8.4
也许是 IPv4 与 IPv6 的问题?尝试添加此行
并尝试连接到主机名
localhost
。如果这不是解决方案,请尝试使用
md5
而不是trust
并为连接用户提供密码。只是为了确保排除这种情况。Perhaps a IPv4 vs IPv6 issue? Try adding this line
and try connecting to the hostname
localhost
.If that's not a solution, please try
md5
instead oftrust
and give the connecting user a password. Just to be sure to rule this out.