欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CentOS环境下安装postgresql9.3

程序员文章站 2022-05-26 17:14:34
...

1

exclude=postgresql*

 2

yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm

 3

yum list postgres*

 4

yum install postgresql93-server

 5

cd /var/lib/pgsql/9.3/data/

 6

service postgresql-9.3 initdb

 7

chkconfig postgresql-9.3 on

 8

service postgresql-9.3 start

 9

vim postgresql.conf
listen_addresses = '*'

 10

vim pg_hba.conf
host    all             all             192.168.0.0/24          password

 11

passwd postgres

 12

vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8888 -j ACCEPT
service iptables restart

 13

service postgresql-9.3 restart

 14

su postgres
psql -U postgres
postgres=# ALTER USER postgres WITH PASSWORD 'postgres'
postgres=# \q