阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS5.8_x64下离线安装PostgreSQL 9.1

166次阅读
没有评论

共计 2038 个字符,预计需要花费 6 分钟才能阅读完成。

操作系统:CentOS5.8_x64

PostgreSQL 版本:9.1

问题描述

服务器未连接公网时怎么安装 PostgreSQL 数据库?

服务器版本为: CentOS5.8_x64

需要安装的 PostgreSQL 版本为:9.1

解决方案

解决 yum 源的问题【可选】

wget http://archives.Fedoraproject.org/pub/archive/epel/5/x86_64/epel-rpm-macros-5-7.noarch.rpm
rpm -ivh epel-rpm-macros-5-7.noarch.rpm
yum clean all && yum clean metadata && yum clean dbcache && yum makecache

添加 PostgreSQL 源并下载 PostgreSQL

wget https://download.postgresql.org/pub/repos/yum/9.1/RedHat/rhel-5Server-x86_64/pgdg-centos91-9.1-6.noarch.rpm --no-check-certificate
rpm -ivh pgdg-centos91-9.1-6.noarch.rpm
yum search postgres
mkdir psql91
yum install --downloadonly --downloaddir=psql91 postgresql91 postgresql91-server
tar zcvf psql91.tar.gz psql91

–downloadonly 参数需要安装 yum-downloadonly,命令如下:

yum install yum-downloadonly

如果上述安装命令无法安装的话,可以从 CentOS5.8 的 DVD 安装盘里面把 rpm 包 copy 出来即可,然后执行安装命令:

rpm -ivh yum-downloadonly-1.1.16-21.el5.centos.noarch.rpm

离线安装 PostgreSQL

将 psql91.tar.gz 文件 copy 到需要安装的机器上,执行以下命令:

tar zxvf psql91.tar.gz
cd psql91
rpm -ivh postgresql91-libs-9.1.24-2PGDG.rhel5.x86_64.rpm
rpm -ivh postgresql91-9.1.24-2PGDG.rhel5.x86_64.rpm
rpm -ivh postgresql91-server-9.1.24-2PGDG.rhel5.x86_64.rpm

其它

初始化数据库:

service postgresql-9.1 initdb

配置开机启动:

chkconfig postgresql-9.1 on

启动服务:

service postgresql-9.1 start

创建用户示例代码:

su - postgres
psql
CREATE USER uadmin WITH PASSWORD '123456';
CREATE DATABASE testdb OWNER uadmin;
GRANT ALL PRIVILEGES ON DATABASE testdb to uadmin;

好,就这些了,希望对你有帮助。

Ubuntu 16.04 下安装 PostgreSQL 和 phpPgAdmin  http://www.linuxidc.com/Linux/2016-08/134260.htm

Linux 下 RPM 包方式安装 PostgreSQL  http://www.linuxidc.com/Linux/2016-03/128906.htm

Linux 下安装 PostgreSQL  http://www.linuxidc.com/Linux/2016-12/138765.htm

Linux 下 PostgreSQL 安装部署指南  http://www.linuxidc.com/Linux/2016-11/137603.htm

Linux 下安装 PostgreSQL 并设置基本参数  http://www.linuxidc.com/Linux/2016-11/137324.htm

Ubuntu 16.04 下 PostgreSQL 主从复制配置  http://www.linuxidc.com/Linux/2017-08/146190.htm

Fedota 24 将数据库升级到 PostgreSQL 9.5  http://www.linuxidc.com/Linux/2016-11/137374.htm

CentOS7 安装配置 PostgreSQL9.6  http://www.linuxidc.com/Linux/2017-10/147536.htm

CentOS 6.5 下 PostgreSQL 服务部署  http://www.linuxidc.com/Linux/2017-01/139144.htm

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-10/147822.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计2038字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中