1 开启密码验证并监听所有ip的请求
在postgresql.conf文件中修改
$ vi /var/lib/pgsql/9.6/data/postgresql.conf
// #password_encryption = on
// 修改为
//password_encryption = on
//#listen_addresses = 'localhost'
// ->javascript:void(null)
//listen_addresses = '*'
- pg_hba.conf
$ vi /var/lib/pgsql/9.6/data/pg_hba.conf
//修改为如下配置
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
- 重启服务restart postgres9.6
$systemctl restart postgresql-9.6
网友评论