1.3. PostgreSQL 官方 YUM 源安装
生活随笔
收集整理的這篇文章主要介紹了
1.3. PostgreSQL 官方 YUM 源安装
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
CentOS 6.4 環(huán)境 YUM 地址 http://yum.postgresql.org/
1.3.1.?9.2
# yum install http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm # yum list postgres*# yum install postgresql92-server postgresql92chkconfig postgresql-9.2 on service postgresql-9.2 initdb service postgresql-9.2 start配置文件的位置
# ls /var/lib/pgsql/9.2/data/*.conf /var/lib/pgsql/9.2/data/pg_hba.conf /var/lib/pgsql/9.2/data/pg_ident.conf /var/lib/pgsql/9.2/data/postgresql.conf1.3.2.?9.3
# yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm # yum install postgresql93-server postgresql93 # chkconfig postgresql-9.3 on # service postgresql-9.3 initdb # service postgresql-9.3 start9.2 升級到 9.3
備份數(shù)據(jù)庫
# su - postgres $ pg_dump -f wechat.sql wechat升級數(shù)據(jù)庫
關(guān)閉9.2,啟動9。3
# chkconfig postgresql-9.2 off # service postgresql-9.2 stop# service postgresql-9.3 start回復(fù)數(shù)據(jù)庫
# su - postgres $ createuser -r -s -P dba $ createuser -P wechat $ createdb -E UTF8 -O wechat wechat $ cat wechat.sql | psql wechat合并配置文件
$ cp 9.3/data/postgresql.conf{,.original} $ cp 9.3/data/pg_hba.conf{,.original} $ vimdiff 9.2/data/postgresql.conf 9.3/data/postgresql.conf $ vimdiff 9.2/data/pg_hba.conf 9.3/data/pg_hba.conf注意 vimdiff 命令是文件對比于合并工具,建議你選擇你比較熟悉的工具。
# service postgresql-9.3 restart1.3.3.?9.4
CentOS 6
https://github.com/oscm/shell/blob/master/database/postgresql/postgresql93-centos6.sh
CentOS 7
https://github.com/oscm/shell/blob/master/database/postgresql/postgresql93-centos7.sh
#!/bin/bash# CentOS 7 yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm yum install -y postgresql96-server postgresql96-contribsystemctl initdb postgresql-9.6 chkconfig postgresql-9.6 oncp /var/lib/pgsql/9.6/data/postgresql.conf{,.original} cp /var/lib/pgsql/9.6/data/pg_hba.conf{,.original} cp /var/lib/pgsql/9.6/data/pg_ident.conf{,.original}sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" /var/lib/pgsql/9.6/data/postgresql.confsystemctl start postgresql-9.6iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT systemctl save iptables一鍵安裝
curl -s https://raw.githubusercontent.com/oscm/shell/master/database/postgresql/postgresql93-centos7.sh | bash1.3.4.?9.6
https://github.com/oscm/shell/blob/master/database/postgresql/postgresql96-centos7.sh
一鍵安裝
curl -s https://raw.githubusercontent.com/oscm/shell/master/database/postgresql/postgresql96-centos7.sh | bash1.3.5.?10
一鍵安裝 PostgreSQL 10
curl -s https://raw.githubusercontent.com/oscm/shell/master/database/postgresql/10/repository.sh | bash curl -s https://raw.githubusercontent.com/oscm/shell/master/database/postgresql/10/postgresql-server.sh | bash
原文出處:Netkiller 系列 手札
本文作者:陳景峯
轉(zhuǎn)載請與作者聯(lián)系,同時(shí)請務(wù)必標(biāo)明文章原始出處和作者信息及本聲明。
總結(jié)
以上是生活随笔為你收集整理的1.3. PostgreSQL 官方 YUM 源安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 12c:CREATE DATABASE—
- 下一篇: linux cmake编译源码,linu