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", user "postgres", database "postgres"
PostgreSQL數據庫為了安全,它不會監聽除本地以外的所有連接請求,當用戶通過JDBC訪問是,會報一些如下的異常:
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
要解決這個問題,只需要在PostgreSQL數據庫的安裝目錄下找到/data/pg_hba.conf,找到“# IPv4 local connections:”
在其下加上請求連接的機器IP
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5