LINUX离线安装postgres,rpm方式安装

1.下载postgres

系统 版本
CentOS 7 rhel7 rpm
BC-Linux 7 rhel7 rpm
CentOS 8 rhel8 rpm
BC-Linux 8 rhel8 rpm

rhel8 rpm

https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8-x86_64/

rhel7 rpm
https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-7-x86_64/

上边两个链接都是,根据linux版本自行选择下载,

打开链接后Ctrl+F搜索"postgresql14-14",结果会出来一堆包(小版本不同),随便选一个下载,随后分别下载其他包,总共需要下载三个包如下:(小版本必须一致),

postgresql14-14*****

postgresql14-server-14*****

postgresql14-libs-14*****

2.准备安装

将三个包上传到离线服务器的同一个文件夹中,准备开始安装:

不检查依赖直接安装

rpm -ivh *.rpm --nodeps

初始化

/usr/pgsql-14/bin/postgresql-14-setup initdb

启动数据库

systemctl start postgresql-14

设置开机启动

systemctl enable postgresql-14

进入数据库

su - postgres

psql

#设置密码

ALTER USER postgres WITH PASSWORD 'cmdi@123';

然后退出数据库

#编辑配置文件

/var/lib/pgsql/14/data/pg_hba.conf

修改内容

IPv4 本地连接 改成(推荐)

host all all 127.0.0.1/32 md5

部署完成!!!!!!!!!!!

相关推荐
十日十行4 小时前
Linux和window共享文件夹
linux
Sinclair8 小时前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
木心月转码ing12 小时前
WSL+Cpp开发环境配置
linux
Rockbean1 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
蝎子莱莱爱打怪1 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
茶杯梦轩1 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
崔小汤呀2 天前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应2 天前
vi编辑器使用
linux·后端·操作系统
何中应2 天前
Linux进程无法被kill
linux·后端·操作系统
何中应2 天前
rm-rf /命令操作介绍
linux·后端·操作系统