CentOS7 及 RockyLinux 通过 yum安装PostgreSQL 14

centos7 运维 · systemofdown · 于 1年前 发布 · 1586 次阅读

快速使用yum安装PostgreSQL Server最新版

CentOS7 自带的PostgreSQL Server版本是9.x系列, 实际上官方稳定版已经是14了.

安装说明

一切不如意都是不愿意看官方文档.

第一步就是打开官方文档, 找到对应的发行版本的安装介绍页面, https://www.postgresql.org/download/linux/redhat/

如上图所示, 蓝色区域是支持的发行版本, 红色区域是根据实际情况选择后,会生成安装脚本.

本文的环境是CentOS7 ,需要安装14系列则有了以下安装步骤:

安装库

sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

安装postgresql14-server

sudo yum install -y postgresql14-server

初始化

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

设置开机启动

sudo systemctl enable postgresql-14

启动postgresql

sudo systemctl start postgresql-14

本文由 systemofdown 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。

共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册