CentOS下安裝postgresql

1、說明


postgresql版本:9.4.1linux

安裝包:sql

postgresql94-server-9.4.1-1PGDG.rhel6.x86_64.rpm數據庫

postgresql94-libs-9.4.1-1PGDG.rhel6.x86_64.rpmapi

postgresql94-contrib-9.4.1-1PGDG.rhel6.x86_64.rpmpost

postgresql94-9.4.1-1PGDG.rhel6.x86_64.rpmspa

2、執行安裝


 

一、安裝PostgreSQL,注意安裝順序postgresql

 rpm -ivh postgresql94-libs-9.4.1-1PGDG.rhel6.x86_64.rpmcode

rpm -ivh postgresql94-9.4.1-1PGDG.rhel6.x86_64.rpmserver

rpm -ivh postgresql94-server-9.4.1-1PGDG.rhel6.x86_64.rpmblog

rpm -ivh postgresql94-contrib-9.4.1-1PGDG.rhel6.x86_64.rpm

若是安裝報錯,執行

yum install -y openssl

二、初始化數據庫

service postgresql-9.4 initdb

三、啓動服務

service postgresql-9.4 start

四、把PostgreSQL 服務加入到啓動列表

chkconfig  postgresql-9.4 on

chkconfig --list|grep postgres

五、修改PostgreSQL 數據庫用戶postgres的密碼(注意不是linux系統賬號)

#su - postgres

$ psql

# ALTER USER postgres WITH PASSWORD 'postgres'; 
# select * from pg_shadow ;

六、修改PostgresSQL 數據庫配置實現遠程訪問

相關文章
相關標籤/搜索