JDBC to PostgreSQL自升级Ubuntu以来无效

时间:2011-10-17 17:06:15

标签: postgresql ubuntu jdbc

所以我使用8.4(?)让PostgreSQL在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.

有什么想法吗?

2 个答案:

答案 0 :(得分:2)

this site默认端口为5432,但是,根据默认安装的postgres.conf文件,端口设置为5433 ...

port = 5433

因此,如果其他人遇到此问题,请尝试使用新端口。

我认为这与安装在看到现有8.4

时递增端口有关

答案 1 :(得分:0)

可能是IPv4与IPv6的问题?尝试添加此行

host    all         all         ::1/128               trust

并尝试连接主机名localhost

如果这不是解决方案,请尝试md5而不是trust,并为连接用户提供密码。只是为了确定这一点。