安装postgres

1.yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
2.yum install -y postgresql96
3.yum install -y postgresql96-server
4./usr/pgsql-9.6/bin/postgresql96-setup initdb
5.systemctl enable postgresql-9.6
6.systemctl start postgresql-9.6 
7.su - postgres
8. psql -U postgres
9.alter user postgres with password 'Open'       修改postgres的密码
10. listen_addresses='*' /var/lib/pgsql/9.6/data/postgresql.conf    --如过要通过远程连接需要增加这个配置
11. host all all 0.0.0.0/0 md5 /var/lib/pgsql/9.6/data/pg_hba.conf  --如过要通过远程连接需要增加这个配置
12.systemctl restart postgresql-9.6

posted @ 2020-06-04 15:09  822636093  阅读(68)  评论(0编辑  收藏  举报