安装
yum installhttp://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-2.noarch.rpm-y
yum install postgresql95-server postgresql95-contrib -y
service postgresql-9.5 initdb
service postgresql-9.5 start
配置
cd /var/lib/pgsql/9.5/data
vi pg_hba.conf
host all all 0.0.0.0/0 md5
vi /var/lib/pgsql/9.5/data/postgresql.conf
listen_address=‘*’
设置密码
su postgres
psql
ALTER USER postgres WITH PASSWORD ‘123456’;
重启
service postgresql-9.5 restart
防火墙
vi /etc/sysconfig/iptables
-A INPUT -p tcp -m multiport –dport 5432 -j ACCEPT
本机上
psql -h 123.123.123.123 -U postgres