本文只讲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-2.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.信任远程连接

vim /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,如果是所有则0.0.0.0/0)  trust

10.重启服务

systemctl restart postgresql-10

11.使用DBMS软件连接

这里使用的是Navicat

连接成功:

安装 PGAdmin4:

1:yum -y install epel-release

2.yum install pgadmin4

3./usr/pgadmin4/bin/pgadmin4-web-setup.sh

4.

cd /usr/lib/python2.7/site-packages/pgadmin4-web/

vim config_local.py
#设置你希望的IP,0.0.0.0表示不受限制,如果你只希望局域网内访问,请使用适当的局域网ip
DEFAULT_SERVER = '0.0.0.0'
#设置你希望的端口
DEFAULT_SERVER_PORT = 8080
 

5.python /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.py

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

  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

    本文只讲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. 解决maven update project 后项目jdk变成1.5的问题

    一.问题描述 在Eclipse中新建了一个Maven工程, 然后更改JDK版本为1.7, 结果每次使用Maven > Update project的时候JDK版本都恢复成1.5. 二.原因分析 ...

  2. tomcat 、eclipse插件安装、一个机器安装多个tomcat、tomcat闪退的问题解决

    一.正常情况下 (1)新建三个系统变量:tomcat的安装路径 TOMCAT_HOME=E:\tomcat-6.0.39 CATALINA_HOME=E:\tomcat-6.0.39 CATALINA ...

  3. New users can not log on Win8

    方案: http://www.eightforums.com/tutorials/38838-user-profile-service-failed-sign-fix-windows-8-a.html ...

  4. [C#]“正在终止线程”的问题

    在C#中启用线程后,如果试图使用Abort方法来终止线程,那么必定会抛出“正在终止线程”的异常,一开始我也想过如何来避免这种异常出现,花了不少气力,但最后发现全是徒劳. 原因是一个正在运行的线程被终止 ...

  5. AOP (切点表达式讲解)

    Spring EL表达式:: 1.execution 表达式 语法格式: execution(返回类型.包名.类名.方法名(参数表)) exection(*.com.xxx.AService.*(.. ...

  6. 2019.01.23 hdu1964 Pipes(轮廓线dp)

    传送门 题意简述:给一个没有障碍的网格图,任意两个格子连通需要花费一定代价,现在求一条覆盖所有格子的哈密顿回路的总权值的最小值. 思路: 跟这道题一毛一样,除了把求和变成求最小值以外. 代码: #in ...

  7. 微信小程序app.json配置

    找到app.json文件,找到window配置项 1.windows选项下导航栏样式 "navigationBarBackgroundColor":#F6F6F6 // 导航栏的背 ...

  8. telegraph.conf配置

    原文:http://www.cnblogs.com/smail-bao/p/7002361.html 1.操作系统基础监控指标配置标准 基础监控使用通用的全局配置文件telegraf.conf,以下只 ...

  9. char与CString相互转换

    Char -> CStringchar ch[] = "Hello";CString str;str.Format("%s",ch);CString -& ...

  10. maven打包某个分支的包

    maven打某个分支的包命令: mvn clean install -Dmaven.test.skip=true -Pdevelop