zy37275
  • 在联网的机器上安装postgresql yum 源官网链接
[root@localhost yum.repos.d]# yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm

或者

[root@localhost]# wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-42.0-4.noarch.rpm
[root@localhost]# rpm -ivh pgdg-redhat-repo-42.0-4.noarch.rpm
  • 替换$releasever为系统版本号
[root@localhost yum.repos.d]# sed -i \'s/$releasever/6/g\' /etc/yum.repos.d/pgdg-redhat-all.repo
  • 安装依赖
[root@localhost]# yum install --downloadonly --downloaddir=psql10 libicu postgresql10-libs
  • 安装软件包
[root@localhost]# yum install --downloadonly --downloaddir=psql10 postgresql10 postgresql10-server
  • 初始化数据库并启用自动启动:
service postgresql-10 initdb 
chkconfig postgresql-10 on 
service postgresql-10 start
  • 离线安装下载完成的rpm
[root@bogon psql10]# ll
总用量 12208
-rw-r--r-- 1 root root 5157464 7月  23 2019 libicu-4.2.1-14.el6.x86_64.rpm
-rw-r--r-- 1 root root 1702904 7月  23 2019 postgresql10-10.9-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root  333504 7月  23 2019 postgresql10-libs-10.9-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root 5299092 7月  23 2019 postgresql10-server-10.9-1PGDG.rhel6.x86_64.rpm
  • 使用数据库
su - postgres
psql

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-10-26
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案