CentOS 6.9/7通過yum安裝指定版本的PostgreSQL


PostgreSQL(10+)

一、安裝PostgreSQL

// 安裝EPEL源
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm && rpm -ivh epel-release-6-8.noarch.rpm
// 安裝PGSQL
# yum -y install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm
# yum -y install postgresql10
# yum install -y postgresql10-server
// 初始化啟動服務
# service postgresql-10 initdb
# chkconfig postgresql-10 on
# service postgresql-10 start

備注:對於上面的腳本可以在官網(https://www.postgresql.org/download/linux/redhat/)找到,選擇對應平台即可。

CentOS 7:

// 安裝wget
# yum install -y wget
// 安裝EPEL源
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm && rpm -ivh epel-release-7-11.noarch.rpm
// 安裝PGSQL
# yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
# yum -y install postgresql10
# yum install -y postgresql10-server
// 初始化啟動服務
# /usr/pgsql-10/bin/postgresql-10-setup initdb
# systemctl enable postgresql-10
# systemctl start postgresql-10

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM