欢迎光临
我们一直在努力

CentOS 7.9 安装postgreSQL数据库

查看系统版本

一、切换安装源

        官方的PGDG源已经下线,需要切换成国内的镜像源

1、删掉无效的repo

        rm -f /etc/yum.repos.d/pgdg*.repo

2、新建阿里云 PostgreSQL 15 源

        vim /etc/yum.repos.d/pgdg15-aliyun.repo

        写入

[pgdg15] name=PostgreSQL 15 for RHEL/CentOS 7 – Aliyun
baseurl=https://mirrors.aliyun.com/postgresql/repos/yum/15/redhat/rhel-7-x86_64/
enabled=1
gpgcheck=0

        保存退出

3、清理缓存并安装        

yum clean all
yum makecache
yum install -y postgresql15-server

4、初始化并启动

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

systemctl enable postgresql-15
systemctl start postgresql-15

systemctl status postgresql-15

至此安装OK

赞(0)
未经允许不得转载:171主机测评 » CentOS 7.9 安装postgreSQL数据库
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址