1. 找到 pg_hba.conf
文件位置
find / -name pg_hba.conf
2. 修改 pg_hba.conf
文件
添加一行 (找到相似配置行鹿霸,在下面添加就行)
host all all 0.0.0.0/0 md5
3. 修改 postgresql.conf
文件
將里面的 listen_addresses = 'localhost' 改為 listen_addresses = '*' 記得打開注釋
4. 重啟服務(wù)
service postgresql restart