我正在使用pgAdmin3并使用pkg安装postgreSQL和第 我试图通过tomcat连接到postgreSQL当我做./startup。从我的tomcat/bin目录中的日志文件SH显示了这个错误:错误检测数据库类型:无法创建PoolableConnectionFactory(致命:没有pg_hba.conf
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metaModelDAO' defined in class path resource [applicationContext-coreDataServices.xml]: Invocation of init method failed; nested exception is org.apache.cayenne.CayenneRuntimeException: [v.3.0.1.LB Nov 16 2011 05:24:11] Error detecting database type: Cannot create PoolableConnectionFactory (FATAL: no pg_hba.conf entry for host "10.0.0.197", user "abc_writer", database "abc", SSL off)
以下是我在我的context.xml:
<Context>
<Resource username="abc_writer" password="levelsbeyond"
url="jdbc:postgresql://localhost:5432/abc"
type="javax.sql.DataSource" name="jdbc/abc-workflow"
maxWait="10000" maxIdle="20" maxActive="50"
driverClassName="org.postgresql.Driver" auth="Container" />
</Context>
这里是我的pg_hba.config的样子:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres md5
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
host abc abc_writer 10.0.0.197 md5
当我从PostgreSQL的/ bin中开拓邮政局长它读取此:
localhost:~ bryanraymond$ /Library/PostgreSQL/9.3/bin/postgres ; exit;
postgres cannot access the server configuration file
"/Library/PostgreSQL/9.3/data/postgresql.conf": Permission denied
logout
但愿它说我有pg_hba.conf中的条目是因为我没有权限,如果这样怎么做的原因我获得许可?如果这不是问题,我是否有设置错误?
---谢谢你,布莱恩
当你运行'psql -h localhost -U abc_writer -d abc'时会发生什么? –
我得到这个:localhost:〜bryanraymond $ psql -h localhost -U abc_writer -d abc psql(9.1.9,server 9.3.0) 警告:psql版本9.1,服务器版本9.3。 某些psql功能可能无法正常工作。 输入“help”寻求帮助。 abc =# – user2864917