PostgreSQL Connect Error: FATAL: no pg_hba.conf entry for host

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 database will not listen for all connection requests except local ones for security. When users access the database through JDBC, they will report some exceptions as follows:

org.postgresql.util.PSQLException: FATAL:nopg_ hba.confentryforhost

To solve this problem, you only need to find/data/PG in the installation directory of PostgreSQL database_ Hba.conf, find “# IPv4 local connections:”

Add the IP of the machine to which the connection is requested

hostall all 127.0.0.1/32 md5

32 is the segment of the subnet mask; MD5 is a password verification method, which can be changed to trust

Similar Posts: