pgsql 遠程機器無法連接數據庫報錯處理方法


因本地資源有限,在公共測試環境搭建了PGsql環境,從數據庫本地localhost訪問正常,在相同網段的遠程機器訪問報如下錯誤

“server closed the connection unexpectedly.        This probably means the server terminated abnormally before or  while processing the request”

檢查pg日志,報錯日志為FATAL:  no pg_hba.conf entry for host "XX.XX.XX.XX",經查閱,這條錯誤的原因是因為客戶端遠程訪問postgresql受限所致,因為postgresql默認情況下除本機外的機器是不能連接的。修改pg_hba.conf與postgresql.conf兩個配置文件即可解決。

修改方式請參考https://blog.csdn.net/liuchunming033/article/details/44810899 

 

 

 

 

 

 

參考文檔地址:

程序鏈接PostgreSQL 時報錯"no pg_hba.conf entry" - CSDN博客
https://blog.csdn.net/liuchunming033/article/details/44810899


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM