---恢复内容开始---

1. install linux

2. 切换mirror

a. 备份原来的repo  文件, [root@localhost ~]# mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.backup

b. 查询本机的yum 版本:

[root@localhost ~]# rpm -qa|grep yum
yum-rhn-plugin-2.0.1-6.el7.noarch
yum-langpacks-0.4.2-7.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-3.4.3-150.el7.noarch
PackageKit-yum-1.0.7-6.el7.x86_64
yum-utils-1.1.31-40.el7.noarch

c. 卸载这些自带的

rpm -qa|grep yum|xargs rpm -e --nodeps

d. 下载

wget  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-rhn-plugin-2.0.1-10.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-langpacks-0.4.2-7.el7.noarch.rpm

wget  https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/PackageKit-yum-1.1.5-1.el7.centos.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-32.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-32.el7.x86_64.rpm

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-32.el7.x86_64.rp  --此刻  我已经崩溃啦。。

7. 安装

一堆依赖,根据提示,去下载rpm包,

rpm -Uvh rpm-libs-4.11.3-32.el7.x86_64.rpm rpm-build-libs-4.11.3-32.el7.x86_64.rpm rpm-python-4.11.3-32.el7.x86_64.rpm rpm-4.11.3-32.el7.x86_64.rpm

rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

rpm -ivh yum-3.4.3-158.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm

rpm -ivh yum-*

8.下载 repo 文件,修改参数

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

vim /etc/yum.repos.d/CentOS-Base.repo ,将文件里面的 所有 $releasever 换成7, 我手工一个一个改的, 因为我的版本是 el7, 所以 写成7

:1,$s/$releasever/7/g  --命令模式,从第一行开始,把所有的$releasever 换成7

9. yum clean all  -- 清除缓存

10. yum makecache  --新建缓存, 要是第八步里面 $releasever 没有换成7, 就会报错,

11.Install the repository RPM  -

yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm  

12. 修改pgdg-10-redhat.repo,该文件位于 /etc/yum.repos.d 将文件里面的  $releasever 换成7  :1,$s/$releasever/7/g
13.创建client
yum install postgresql10
14. install server --创建server
yum install postgresql10-server
15. 配置服务自动启动
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10 16. su - postgres - 切换用户
17. psql

-bash-4.2$ createuser bmf  --创建用户,此处是在shell 不连接数据库

-bash-4.2$ createdb  sqlexp  --创建用户,此处是在shell 不连接数据库
-bash-4.2$ psql   --进入postgresql
psql (10.4)
Type "help" for help.

postgres=# alter user bmf with password 'sqlexp'   --修改用户密码
postgres-# ;
ALTER ROLE

----------------配置远程连接------------

18. 修改配置文件 pg_hba.conf  --记得先备份这个文件 mv /var/lib/pgsql/10/data/pg_hba.conf /var/lib/pgsql/10/data/pg_hba.conf.bak
   directory: /var/lib/pgsql/10/data/pg_hba.conf, 我是直接打开文件,直接编辑,在IPV4下面加一行这个记录,然后保存
# TYPE  DATABASE        USER            ADDRESS                 METHOD
host all all 0.0.0.0/0 MD5

19. 修改配置文件 postgresql.conf  --记得备份,

listen_address = '*' , 记得去掉注释符号,否则不能生效

20. 关闭防火墙

systemctl stop firewall.d

21 . 重启服务

systemctl restart postgresql-10

成功了。。可以远程连接了


---恢复内容结束---

install postgresql 10 on redhat linux 7 Redhat 安装 postgresql 10的更多相关文章

  1. RedHat Linux 5.5安装JDK+Tomcat并部署Java项目

    与大家分享下RedHat Linux 5.5安装JDK+Tomcat并部署Java项目的步骤,希望对大家有用. 1.下载并安装jdk 虚拟机中安装RedHat Linux 5.5 64位企业版, 这里 ...

  2. Linux CentOS 7 安装PostgreSQL 9.5.17 (源码编译)

    近日需要将PostgreSQL数据库从Windows中迁移到Linux中,Linux CentOS 7 安装PostgreSQL 9.5.17 安装过程 特此记录. 安装环境: 数据库:Postgre ...

  3. 【转】postgresql 9.4 在linux环境的安装步骤详解

    本文章来为各位介绍一篇关于postgresql 9.4 在linux环境的安装步骤详解,希望文章能够对各位新手朋友带来帮助的哦. 环境说明系统:centos 6.4 64位软件:postgresql ...

  4. Redhat 7.2 编译安装PostgreSQL 10

    1.环境说明 CentOS7.2 postgresql10.4 2.下载 postgresql的官方地址 https://www.postgresql.org/ftp/source/ 在下载列表中根据 ...

  5. perconaXTRADB Cluster在Redhat Linux上的安装

    installing-perconaXTRADB Cluster 5.6 For Redhat 6.4 一.server版本号查看 Root# cat /etc/redhat-release Red ...

  6. RAC分解步骤之一,在oracle linux 4u4上安装oracle 10.2.0.1.0操作日志

    练习oracle的rac组建过程,第一步,先练习4u4上安装oracle 10.2.0.1.0.直接安装rac,有些难度.从简单的做起.总RAC步骤,参照小布老师的RAC组建. 1. 启动vc,登陆v ...

  7. linux下编译安装MariaDB 10.4.7,解决错误:cannot access ‘/auth_pam_tool_dir’: No such file or directory

    编译安装MariaDB 10.4.7,前面的步骤我就不复述了,一切正常没什么问题. 当执行到:scripts/mysql_install_db --basedir=/usr/local/mysql - ...

  8. redhat linux 5.3安装activeMQ

    安装环境:linux redhat enterprise 5.3 activemq版本:5.9.01.从http://activemq.apache.org/download.html地址下载apac ...

  9. Redhat Linux 系统上安装JDK 1.7

    作者:潇湘隐者 出处:http://www.cnblogs.com/kerrycode/ 步骤1:下载JDK 1.7 安装包  JDK 1.7 下载地址:http://www.oracle.com/t ...

随机推荐

  1. gitlab 添加 ssh

    git 客户端无法拉取gitlab仓库代码,登陆网页端,查看仓库主页有下面的提示 因此需要添加ssh公钥,才能上传下拉代码 windows平台: 首先需要安装git了. 在存放代码的目录中,右键选择 ...

  2. cpt212b--- 触摸芯片配置

    软件的应用: 1.可以依照你所需要的芯片类型建立适当的工程,下面是在没有j-link的情况时的一种操作方式 建立完工程后,cpt212b的配置参数页面如上,更改参数点击Save 按钮,软件自动生成 . ...

  3. 【java8】使用lambda表达式对List去重

    先收集再排序. public static void main(String[] args) { BookBo bookBo1 = new BookBo("1", "语文 ...

  4. codechef February Challenge 2018 简要题解

    比赛链接:https://www.codechef.com/FEB18,题面和提交记录是公开的,这里就不再贴了 Chef And His Characters 模拟题 Chef And The Pat ...

  5. 面试题_默认传参list

    # ###2.值是多少 def extendList(val, list=[]): list.append(val) return list 如果默认形参是列表,会提前在内存中开辟一个空间存储列表 如 ...

  6. FTP上传文件,报错java.net.SocketException: Software caused connection abort: recv failed

    FTP上传功能,使用之前写的代码,一直上传都没有问题,今天突然报这个错误: java.net.SocketException: Software caused connection abort: re ...

  7. 【转载】许纪霖教授在上海财经大学演讲——漫谈“大学生的四个Learn”

    这几年,越来越多的大学毕业生抱怨找不到合意的工作.很多单位又感叹,找一个称职的大学生真难.这就形成一个非常大的反差和矛盾.那么,社会究竟需要怎样的大学生?我们的大学到底应该培养怎样的大学生?我们作为大 ...

  8. springboot项目简单启动脚本

    #!/bin/bash function log_info () { DATE=`date "+%Y-%m-%d %H:%M:%S"` USER=$(whoami) echo &q ...

  9. Supervisor配置

    Supervisor(http://supervisord.org/)是用Python开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统 ...

  10. key diff 在input上的踩坑

    1.在react-native 遇到一个坑,希望的效果如下,同一个按钮,不同的状态下显示不同的input. 2.然后,在做的时候遇到了这样一个问题.输入我的姓名,点击下一步 3.问题出来了,输入框已经 ...