su – postgres
psql -U postgres
ALTER USER postgres with encrypted password '密码'
配置远程访问
1
2
3
4
5
6
vim /var/lib/pgsql/9.4/data/postgresql.conf
listen_address ="*"vim /var/lib/pgsql/9.4/data/pg_hba.conf
IPv4 local connections下方添加允许连接的IP
host all all 0.0.0.0/0 md5