The server doesn't grant access to the database: the server reports
FATAL: no pg_hba.conf entry for host "192.168.0.123",user "postgres",database "postgres" FATAL: no pg_hba.conf entry for host "192.168.0.123",database "postgres"
Postgresql数据库为了安全,它不会监听除本地以外的所有连接请求,当用户通过JDBC访问是,会报一些如下的异常:
org.postgresql.util.PsqlException: FATAL:nopg_hba.confentryforhost
要解决这个问题,只需要在Postgresql数据库的安装目录下找到/data/pg_hba.conf,找到“# IPv4 local connections:”
在其下加上请求连接的机器IP
hostall all 127.0.0.1/32 md5
32是子网掩码的网段;md5是密码验证方法,可以改(见文件pg_hba.conf上的说明)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。