修改 pg_hba.conf,在
host all all 127.0.0.1/32 md5
下面添加一行
host all all 0.0.0.0/0 md5
修改 postgresql.conf,将
listen_addresses = 'localhost'
改为
listen_addresses = '*'
最后重启数据库使配置生效:
pg_ctl restart