centos安装与卸载postgresql

一、卸载旧版本postgresqlsql

$ yum remove postgresql*

二、更新yumcentos

$ yum update

三、下载pgdg-centos92-9.2-6.noarch.rpm,或者到http://yum.pgrpms.org/reporpms/选择相应版本bash

 wget http://yum.pgrpms.org/9.2/redhat/rhel-5-x86_64/pgdg-centos92-9.2-6.noarch.rpm

四、post

rpm -ivh pgdg-centos92-9.2-6.noarch.rpm 

五、spa

$ sudo yum -y install postgresql92-server

六、初始化postgresql

$ service postgresql-9.2 initdb

若是提示-bash: service: command not found,则须要设置环境变量code

$vi .bash_profile
export PATH=$PATH:/sbin

七、启动postgresqlserver

$ service postgresql-9.2 start

八、设置开机自动启动服务

blog

chkconfig postgresql-9.2 on

九、rem

相关文章
相关标签/搜索