本文只讲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. TP QQ 微信 微博登录

    use Org\Util\QQconnect; use Org\Util\Wechatauth; use Org\Util\SaeTOAuthV2; use Org\Util\SaeTClientV2 ...

  2. 繁体简体转化_langconv.py

    from copy import deepcopyimport re try: import psyco psyco.full()except: pass try: from zh_wiki impo ...

  3. idea15 生成mybatis代码

    pom.xml <build> <finalName>mybatis_generator</finalName> <plugins> <plugi ...

  4. msgs no .h file

    1.单独编译包,catkin_make --pkg 包名,failed,则 2.进入build下对应的msgs包中,使用make,以及make install,failed,则 3.使用catkin_ ...

  5. VSFTPD虚拟用户配置

    转载:http://www.cnblogs.com/allenjin/archive/2011/12/03/2274542.html 以下操作验证OK!!!! VSFTPD虚拟用户配置 VSFTP = ...

  6. [Office]Execl取消保护密码

    2007版Excel表格中可以按照以下方式建宏: 打开Excel表格中的Excel选项,选择自定义,得到如下画面:  然后在左边侧框栏中选择“查看宏”或者Alt+F11 之后双击或者选择添加按钮,则可 ...

  7. mybatis学习七 typeAliases 别名

    1. mybatis中内置的一些别名,例如Map,List,int 等常用类型 2.手动为某个类设置别名 在mybatis的全局配置文件中加如下代码 <typeAliases> <t ...

  8. day05作业---字典

    # 字典找位置 用键, 列表.元组找位置 用索引'''1.有如下变量(tu是个元祖),请实现要求的功能tu = ("alex", [11, 22, {"k1": ...

  9. 求一个数的n次幂

    1.当这个数是2的多少次幂: 求(2^m)^n  =  2^(m*n) = 1<<m*n; 2.快速幂(要考虑底数a,和m的正负) int quick_mod(int a,int m){ ...

  10. 一窥kbmmw中的 smart service

    在kbmmw 的新版中(还没有发布),将会有一个叫做smart service 的服务.这种服务的属性基于服务器端,并且可以自动注册服务名,下面就是一个简单例子代码.这个服务里面有有三个发布的函数:e ...