yum install -y https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql95-server postgresql95-contrib
/usr/pgsql-9.5/bin/postgresql95-setup initdb
systemctl start postgresql-9.5
systemctl enable postgresql-9.5
firewall-cmd --add-service=postgresql --permanent
firewall-cmd --reload
远程连接配置
vi /var/lib/pgsql/9.5/data/postgresql.conf
修改
listen_addresses = '*'
vi /var/lib/pgsql/9.5/data/pg_hba.conf
注释
host all all peer
host all all 127.0.0.1/32 ident
添加host all all all md5