本文只讲PostgreSQL在CentOS 7.x 下的安装,其他系统请查看:https://www.postgresql.org/download

PostgreSQL 所用版本为:PostgreSQL 10

1.安装存储库

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

2.安装客户端

yum install postgresql10

3.安装服务端

yum install postgresql10-server

4.验证是否安装成功

rpm -aq| grep postgres

输出如下:

4.初始化数据库

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

5.启用开机自启动

systemctl enable postgresql-10
systemctl start postgresql-10

6.配置防火墙

firewall-cmd --permanent --add-port=5432/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

7.修改用户密码

    su - postgres  切换用户,执行后提示符会变为 '-bash-4.2$'
    psql -U postgres 登录数据库,执行后提示符变为 'postgres=#'
    ALTER USER postgres WITH PASSWORD 'postgres'  设置postgres用户密码为postgres
    \q  退出数据库

8.开启远程访问

     vim /var/lib/pgsql/10/data/postgresql.conf
修改#listen_addresses = 'localhost' 为 listen_addresses='*'
当然,此处‘*’也可以改为任何你想开放的服务器IP

9.信任远程连接

    vi m/var/lib/pgsql/10/data/pg_hba.conf
    修改如下内容,信任指定服务器连接
    # IPv4 local connections:
    host    all            all      127.0.0.1/32      trust
    host    all            all      192.168.157.1/32(需要连接的服务器IP)  trust

10.重启服务

systemctl restart postgresql-10

11.使用DBMS软件连接

这里使用的是Navicat

连接成功:

Centos 7 安装 PostgreSQL的更多相关文章

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

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

  2. CentOS 7 - 安装PostgreSQL

    一,用yum安装PostgreSQL . 选择安装版本和服务器平台后,执行安装命令,例如我要安装是9.6版本,平台是CentOS 7. https://www.postgresql.org/downl ...

  3. CentOS下安装postgresql

    一.说明 postgresql版本:9.4.1 安装包: postgresql94-server-9.4.1-1PGDG.rhel6.x86_64.rpm postgresql94-libs-9.4. ...

  4. 阿里云服务器 centos 7 安装postgresql 11

    Postgresql简介 官方网站:https://www.postgresql.org/ 简介参考zhihu文章 https://www.zhihu.com/question/20010554 关于 ...

  5. CentOS 6安装PostgreSQL

    https://zh.wikipedia.org/wiki/PostgreSQL PostgreSQL是自由的对象-关系型数据库服务器(数据库管理系统),在灵活的BSD-风格许可证下发行.它在其他开放 ...

  6. Centos 7 安装 PostgreSQL PGAdmin4

    本文只讲PostgreSQL在CentOS 7.x 下的安装,其他系统请查看:https://www.postgresql.org/download PostgreSQL 所用版本为:PostgreS ...

  7. centos 7安装postgresql10.3

    最新版本安装请移步:阿里云服务器 centos 7 安装postgresql 11 一.Postgresql简介 官方网站:https://www.postgresql.org/ 简介参考zhihu文 ...

  8. Linux 安装 PostgreSQL

    Linux 安装 PostgreSQL CentOS 7 安装 PostgreSQL 10 步骤 官网安装步骤,选择服务器和数据库版本,会给出相应的安装命令 # 安装 yum install -y h ...

  9. Linux CentOS安装postgresql 9.4

    一.前言 PostgreSQL通常也简称Postgres,是一个关系型数据库管理系统,适用于各种Linux操作系统.Windows.Solaris.BSD和Mac OS X.PostgreSQL遵循P ...

随机推荐

  1. 线程中WICImage与Bitmap数据转换

    最近项目开发, 要用到线程中对图像进行缩放和二值化处理 为了省事, 图像缩放用的WICImage.ImagingFactory接口, 二值化用的是bitmap.PixelFormat := pf1bi ...

  2. 六:Dubbo与Zookeeper、SpringMvc整合和使用

    DUBBO与ZOOKEEPER.SPRINGMVC整合和使用 互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,Dubbo是一个分布式服务框架 ...

  3. C#去掉字符串头尾指定字符

    private void button2_Click(object sender, EventArgs e)        {//去掉字符串头尾指定字符            string MyInf ...

  4. java的配置环境简介

    ============================================================================== 学java对很多人来说并不陌生,听的最多的 ...

  5. python学习总结笔记(一)

    1.raw_input("请输入:")提示录入信息,读取录入的字符串返回你录入的字符串2.os.environ 获取所有系统的环境变量,返回一个字典.3.str与repr区别str ...

  6. css 模板

    css RESET @CHARSET "gbk"; /*设置编码*/ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote, /** 结构元素 **/ dl ...

  7. 用python实现一个简单的词云

    对于在windows(Pycharm工具)里实现一个简单的词云还是经过了几步小挫折,跟大家分享下,如果遇到类似问题可以参考: 1. 导入wordcloud包时候报错,当然很明显没有安装此包. 2. 安 ...

  8. Abp后台工作者类使用hangfire

    一.Abp中的后台工作及后台工作者类 请阅读这篇文章 二 .Abp官方实现的缺点 Abp官方实现方式很简单,也很容易上手,但缺点是工作者类依赖了具体的基类(PeriodicBackgroundWork ...

  9. 三、Hadoop学习笔记————从MapReduce到Yarn

    Yarn减轻了JobTracker的负担,对其进行了解耦

  10. 02-线性结构4 Pop Sequence

    题目 Sample Input: 5 7 5 1 2 3 4 5 6 7 3 2 1 7 5 6 4 7 6 5 4 3 2 1 5 6 4 3 7 2 1 1 7 6 5 4 3 2 Sample ...