Installing Postgres9.2 in Centos6.3

1:logining into root
su root


2:Download Postgresql Yum repo to Centos

[root@localhost ~]# wget http://yum.pgrpms.org/9.2/redhat/rhel-6.3-x86_64/pgdg-centos92-9.2-6.noarch.rpm


3. Install Repo into our Server

[root@localhost ~]# rpm -ivh pgdg-centos92-9.2-6.noarch.rpm
  
4:Exclude postgresql in CentOS-Base.repo


vi /etc/yum.repos.d/CentOS-Base.repo



5: Install Postgresql by yum

[root@localhost yum.repos.d]# yum install postgresql92 postgresql92-devel postgresql92-server postgresql92-libs postgresql92-contrib -y


6. Start Postgresql and
check postgresql process

[root@localhost yum.repos.d]# service postgresql-9.2 initdb
[root@localhost yum.repos.d]# /etc/init.d/postgresql-9.2 start 
[root@localhost yum.repos.d]# netstat -nutlap | grep post


7.Open
/var/lib/pgsql/9.2/data/postgresql.conf file, and add/uncomment/modify following: 
listen_addresses = '*' 
port = 5432


8:Edit
/etc/sysconfig/iptables file
[root@localhost yum.repos.d]# vi /etc/sysconfig/iptables
Add following line before -A
INPUT -j REJECT… -A INPUT -m state --state NEW -m tcp -p tcp
--dport 5432 -j ACCEPT
 
9:Set PostgreSQL
Permissions 


Modify PostgreSQL
/var/lib/pgsql/9.2/data/pg_hba.conf (host-based authentication)
file: host all phonelwc 192.168.1.1/32 md5


 10:restart postgres server

[root@localhost

yum.repos.d]#service postgresql-9.2restar


11:Linking:




發佈了38 篇原創文章 · 獲贊 24 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章