安装数据库

安装参考官方文档:https://www.postgresql.org/download/linux/redhat/

1.Install the repository RPM:
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
2.Install the client packages:安装client工具
yum install postgresql10
3.Optionally install the server packages:安装服务端
yum install postgresql10-server
4.Optionally initialize the database and enable automatic start:初始化数据库并启动pgsql
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10

调整数据库配置

数据文件目录:

[root@fkkfapp data]# pwd
/var/lib/pgsql/10/data

修改数据库监听端口,开放所有ip监听,增加所有 ipv4地址接入权限

1.修改postgresql.conf文件


[root@fkkfapp data]# vi /var/lib/pgsql/10/data/postgresql.conf

修改以下部分:

listen_addresses = '*'
port = 1521

我因为外网代理端口的原因所以修改为1521,正常不需要修改

2.修改pg_hba.conf文件

[root@fkkfapp data]# vi /var/lib/pgsql/10/data/pg_hba.conf

新增第三行信息

# IPv4 local connections:
host all all 127.0.0.1/32 ident
host all all 0.0.0.0/0 trust

3.修改/etc/profile文件,增加PGPORT设置

vi /etc/profile
export PGPORT=1521

4.切换到postgres用户,测试是否可以连接

-bash-4.2$ psql
psql (10.4)
Type "help" for help. postgres=#

5.使用外网navicat测试,可以登录远程端口

新建用户和数据库

postgres=# create user panda with password 'panda';

postgres=# create database panda owner panda;

postgres=# grant all privileges on database panda to panda;

centos7上的postgresql10安装和配置的更多相关文章

  1. Centos7上HBase的安装和配置

    注意事项 HBase配置必须使用主机名,不支持直接配置IP地址.我尝试过,如果不使用主机名直接用IP,会导致HBase连接zk超时. > 设置主机名 hostnamectl set-hostna ...

  2. centos7上keepalived的安装和配置

    1.环境规划1)master:node1,centos7.5,eth0:192.168.1.11,eht1:10.10.1.11,keepalive2)backup:node1,centos7.5,e ...

  3. 在CentOS7上通过RPM安装实现LAMP+phpMyAdmin过程全记录

    在CentOS7上通过RPM安装实现LAMP+phpMyAdmin过程全记录 时间:2017年9月20日 一.软件环境: IP:192.168.1.71 Hostname:centos73-2.sur ...

  4. PJzhang:centos7上LNMP方式安装dvwa漏洞测试环境

    猫宁!!! 参考链接:https://www.jianshu.com/p/5491ce5bfbac https://www.cnblogs.com/wujuntian/p/8183952.html h ...

  5. CentOS7下NFS服务安装及配置固定端口

    CentOS7下NFS服务安装及配置 系统环境:CentOS Linux release 7.4.1708 (Core) 3.10.0-693.el7.x86_64 软件版本:nfs-utils-1. ...

  6. Centos7 下的SVN安装与配置

    Centos7 下的SVN安装与配置 1.关闭防火墙 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临 ...

  7. CentOS7上Python3.5安装

    CentOS7上Python3.5安装 1.下载 https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz 2.上传到服务器 3. yum in ...

  8. centos7系统下nginx安装并配置开机自启动操作

    准备工作 我的centos7系统是最小化安装的, 缺很多库, 首先安装必须的运行库 ? 1 2 3 4 5 6 7 8 9 10 11 yum install wget gcc gcc-c++ pcr ...

  9. 05、Win7上openSSH的安装与配置

    05.Win7上openSSH的安装与配置 1.概述 linux上的ssh命令在网络通信场景下非常方便.现在windows也支持ssh方式和远程主机进行访问.如果只是使用ssh简单的访问功能,就需要很 ...

随机推荐

  1. Python的网络编程 Socket编程

    Socket是进程间通信的一种方式,与其他进程间通信的一个主要不同是:能实现不同主机间的进程间通信,网络上各种各样的服务大多都是基于Socket来完成通信的,要解决网络上两台主机间的通信问题,首先要唯 ...

  2. web应用安全发展与介绍

    安全与安全圈的认识 中国黑客的发展过程:1990年代初,部分人开始研究黑客技术 1997-1999年,黑客团队涌现,进入黄金时代, 21世纪初,黑客工具傻瓜化,门槛降低,黑客精神不在… 圈内熟知的安全 ...

  3. NSKeyValueObserving.m

    https://github.com/farcaller/cocotron/blob/af740de86c9bee84c59ffc74d27e5df9e22e1391/Foundation/NSKey ...

  4. 那些不明不白的$符号设计--Sass和Emmet,变量设计原理相通

    以前看到php变量的定义,直接使用$符号开始,怎么看都不习惯.后来呀,在使用Emmet的过程中,又接触到了$符号.今天,在学习Sass的过程种,再一次接触到$符号,兴致所致,不由得想写一篇,对比一下搞 ...

  5. saltstack之编写自定义模块

    编写自己的模块 1 默认会放在/srv/salt/_modules vi hello.py """ CLI Example : salt '*' hello.world ...

  6. ajax表单提交post(错误400) 序列化表单(post表单转换json(序列化))

    序列化表单 使用serializeArray()序列化 转换成json格式 function arrayTOjson(node) { var b = "{"; for (var i ...

  7. PAT乙级1023

    1023 组个最小数 (20 分)   给定数字 0-9 各若干个.你可以以任意顺序排列这些数字,但必须全部使用.目标是使得最后得到的数尽可能小(注意 0 不能做首位).例如:给定两个 0,两个 1, ...

  8. N个数中第k个最大者

    #include<stdio.h> #include<stdlib.h> void bubbleSort(int arr[],int n) { int i,j; ;i>; ...

  9. centos配置静态ip地址

    1.输入以下命令: vim /etc/sysconfig/network-scripts/ifcfg-eth0 2.注释掉BOOTPROTO=dhcp 3.添加如下内容: ONBOOT=yes 表示开 ...

  10. linux 学习第二十天(mariadb配置)

    一.mariadb yum install mariadb mariadb-server systemctl restart mariadb systemctl enable mariadb mysq ...