日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

1.3. PostgreSQL 官方 YUM 源安装

發(fā)布時(shí)間:2025/3/21 数据库 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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.conf

1.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 start

9.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 restart

1.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 | bash

1.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 | bash

1.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)明文章原始出處和作者信息及本聲明。

《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的1.3. PostgreSQL 官方 YUM 源安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。