PostgreSQL remote connection method
Sometimes when connecting remotely, it will report Error connecting to the server: fatal error: not used for host “…”, User “…”, database “…”, pg_hba.conf record with SSL closed:
This is because the pg_hba.conf file is not configured correctly during remote connection.
The pg_hba.conf file is in the data folder under the Postgre installation file directory.
After the file is installed correctly, it should look like the following figure:
Add at the end of the file:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 0.0.0.0/0 md5
The end of the file should be:
Reconnect again, there should be no problem.
Note: Generally, to connect to PostgreSQL remotely, it should be connected immediately after clicking the “Connect” button. If you have to wait for a while, an error will usually occur———————— ———————— Copyright Statement: This article is the original article of the CSDN blogger “Passerby JIA”, which follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement for reprinting. Original link: https://blog.csdn.net/u013719339/article/details/78414188