简体   繁体   中英

Postgres: missing or erroneous pg_hba.conf file

I have 2 machines sitting on my desk and connected to the same IP network. I'm trying to connect an application from one machine to the postgres database on the other. At first the host with the application on it was giving me the PSQLException:

FATAL: no pg_hba.conf entry for host "192.168.1.18", user "user1", database "test", SSL off

So I edited my pg_hba.conf file to accept the IP address: 192.168.1.18, by adding the line below at the end of the file:

host    pnp         all         192.168.1.18      trust

Then I got another type of error message:

FATAL: missing or erroneous pg_hba.conf file

Is there anything I'm missing here?

Thanks, Lancelot

You have to specify the netmask of the host too. So either " 192.168.1.18/32 " or " 192.168.1.18 255.255.255.255 " instead of the bare IP address.

See the pg_hba.conf file chapter in the online manual for details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM