本篇内容主要讲解“PostgreSQL 10.12的Yum+rpm安装方法是什么”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“PostgreSQL 10.12的Yum+rpm安装方法是什么”吧!

Yum仓库下载:

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

安装yum仓库:

[root@open_source~]#lsanaconda-ks.cfgpgdg-redhat-repo-latest.noarch.rpm[root@open_source~]#rpm-ivhpgdg-redhat-repo-latest.noarch.rpmwarning:pgdg-redhat-repo-latest.noarch.rpm:HeaderV4DSA/SHA1Signature,keyID442df0f8:NOKEYPreparing...#################################[100%]Updating/installing...1:pgdg-redhat-repo-42.0-6#################################[100%][root@open_source~]#ls-rtl/etc/yum.repos.d/pgdg-redhat-all.repo-rw-r--r--1rootroot5904Sep2709:04/etc/yum.repos.d/pgdg-redhat-all.repo

通过yum安装数据库:

[root@open_source~]#yuminstall-ypostgresql10[root@open_source~]#yuminstallpostgresql10-server

初始化数据库:

[root@open_source~]#/usr/pgsql-10/bin/postgresql-10-setupinitdb

配置开启启动:

[root@open_source~]#systemctlenablepostgresql-10

启动数据库:

[root@open_source~]#systemctlstartpostgresql-10

不限制任何主机并允许远程登陆:

[root@open_source~]#vi/var/lib/pgsql/10/data/postgresql.conf修改listen_addresses=‘*’

修改pg.hba文件需要重启服务:

[root@open_source~]#vim/var/lib/pgsql/11/data/pg_hba.conf添加hostallall0.0.0.0/0md5

到此,相信大家对“PostgreSQL 10.12的Yum+rpm安装方法是什么”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!