📌  相关文章
📜  无法连接到服务器:连接被拒绝 服务器是否在主机上运行并接受端口 5432 上的 TCP IP 连接? - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:44.556000             🧑  作者: Mango

代码示例1
cd /etc/postgresql/9.x/main/
------- open file named postgresql.conf
sudo nano postgresql.conf
------- add this line to that file
listen_addresses = '*'
------- then open file named pg_hba.conf
sudo nano pg_hba.conf
------- and add this line to that file
host  all  all 0.0.0.0/0 md5
------- restart your server
sudo /etc/init.d/postgresql restart