postgres - 允许外网访问
访问量: 1530
写的很明白了。
修改 pg_hba.conf 文件:
host all all 127.0.0.1/32 trust host all all 172.0.0.0/8 trust # 允许 172.x.x.x 访问 host all all 0.0.0.0/0 trust #允许所有ip访问。 建议这里使用md5 , trust会不校验密码
修改 postgresql.conf
listen_addresses = '*'
然后重新启动即可。
pg_ctl restart