本文描述在CentOS 6.6中安装PostgreSQL 9.4的步骤。
安装:
rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm
yum install postgresql94-server
安装后查看状态:
service postgresql-9.4 status
状态为stopped。
初始化数据库:
postgresql安装之后必须先初始化才能使用。执行如下命令:
service postgresql-9.4 initdb
启动并访问:
service postgresql-9.4 start