標籤:
1 yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm2 yum install postgresql94-server postgresql94-contrib3 /usr/pgsql-9.4/bin/postgresql94-setup initdb
開機啟動
1 systemctl enable postgresql-9.4.service
啟動postgresql
1 systemctl start postgresql-9.4.service
遠端存取 允許所有IP訪問
vi /var/lib/pgsql/9.4/data/postgresql.conflisten_addresses =‘*‘vi /var/lib/pgsql/9.4/data/pg_hba.confhost all all 0.0.0.0/0 md5
修改密碼
1 su postgres2 psql -U postgres3 ALTER USER postgres WITH PASSWORD ‘yourpassword‘
如果有防火牆,關掉或者加上
vi /usr/lib/firewalld/services/postgres94.xml<?xml version="1.0" encoding="utf-8"?><service> <short>Postgres 9.4 Database service</short> <description>Postgres</description> <portprotocol="tcp"port="5432"/></service>firewall-cmd --permanent --add-service=postgres94firewall-cmd --reload
在windows上可以用pgAdmin串連管理。
CentOS 7安裝Postgresql