標籤:sql postgre
版本postgresql9.6,CentOS_7,
650) this.width=650;" src="https://s1.51cto.com/wyfs02/M01/9C/3D/wKioL1lty8aAvhisAAETjfAxq9o595.png-wh_500x0-wm_3-wmp_4-s_2809053265.png" title="1.png" alt="wKioL1lty8aAvhisAAETjfAxq9o595.png-wh_50" />
1、使用yum安裝,安裝rpm源。
yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
2、yum安裝
yum install postgresql96
yum install postgresql96-server
3、安裝並啟動
cd /usr/pgsql-9.6/bin
./postgresql96-setup initdb
systemctl start postgresql-9.6
4、配置遠端連線以及修改預設密碼
su postgres
psql
alter user postgres with password ‘123456‘; #修改預設密碼
650) this.width=650;" src="https://s4.51cto.com/wyfs02/M00/9C/3D/wKiom1ltzhOx5oqXAABxQyaa25w706.png-wh_500x0-wm_3-wmp_4-s_1008737365.png" title="2.png" alt="wKiom1ltzhOx5oqXAABxQyaa25w706.png-wh_50" />
cd /var/lib/pgsql/9.6/data/
vim pg_hda.conf
修改下面的
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 0.0.0.0/0 md5 #允許任意ip訪問
vim postgresql.conf
修改
listen_addresses = ‘*‘ #監聽全部
(注意關閉防火牆或者開連接埠)
postgresql 9.6 安裝並配置遠端連線