切换到root账户,

#安装yum 源

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

#安装postgresql11

yum install postgresql11

yum install postgresql11-server

#初始化

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

#开机开启

systemctl enable postgresql-11

#启动db

systemctl start postgresql-11

#登录postgresql并设置密码

su - postgres

psql

#修改密码为dbpasswd

ALTER USER postgres WITH PASSWORD 'dbpasswd';

#退出psql

\q

#退出bash

exit

#修改支持远程登录

vi /var/lib/pgsql/11/data/postgresql.conf

#其中设置 listen_addresses = '*'

vi /var/lib/pgsql/11/data/pg_hba.conf

#最后一行增加

host all all 0.0.0.0/0 md5

#修改后保存,重启postgresql

systemctl restart postgresql-11

#创建db、创建用户、分配权限

CREATE DATABASE testdb;

CREATE USER testuser CREATEDB LOGIN PASSWORD 'dbpasswd';

GRANT ALL ON DATABASE testdb TO testuser;

#删除db、删除用户

drop database testdb;

drop role testuser;

Centos75 安装 postgresql11的更多相关文章

  1. Windows安装PostgreSQL11.1

    Windows安装PostgreSQL11.1 安装过程如下: 1.下载安装包postgresql-11.1-1-windows-x64.exe 2.点击下一步 3.选择安装位置,默认路径C:\Pro ...

  2. CentOs7.5安装PostgreSQL11

    前言 本章介绍在CentOs上安装一个PostgreSQL数据库 下一篇可能是安装 Redis 本篇使用的服务器是已经安装过Python/Nginx等常用软件的环境,因此在安装过程中可能会遇到按照本章 ...

  3. centos7 安装postgresql11

    1 进入postresql官网下载页面,提示了centos相关下载安装等信息. https://www.postgresql.org/download/linux/redhat/   image.pn ...

  4. 安装postgresql11.5

    root身份安装 创建用户 编译安装成功后,接下来要做的就是创建一个普通用户,因为默认超级用户(root)不能启动postgresql,所以需要创建一个普通用户来启动数据库,执行以下命令创建用户: [ ...

  5. 离线安装PostgreSQL11.6

    因为客户最近有一台CentOS7的虚拟机,但是没有联网,需要安装离线安装PostgreSQL 1.首先去官网下载离线安装包 https://www.postgresql.org/download/ 说 ...

  6. CentOS7安装postgreSQL11

    1.添加PostgreSQL Yum存储库 sudo yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel- ...

  7. CentOS75 安装 telnet 进行使用.

    1. 安装必须要的服务 yum install xinetd telnet telnet-server 2. 修改增加root用户登录权限 vi /etc/securetty 在最后面增加两行 pts ...

  8. CentOS75 安装Oracle18c

    1. 参考地址 https://blog.csdn.net/u010257584/article/details/50902472https://www.cnblogs.com/kerrycode/a ...

  9. CentOS7(64) yum安装、配置PostgreSQL 11

    一.安装postgresql11 1.Install the repository RPM: 添加RPM yum install https://download.postgresql.org/pub ...

随机推荐

  1. 基于Cocos2d-x学习OpenGL ES 2.0系列——OpenGL ES渲染之Shader准备(7)

    Cocos2d-x底层图形绘制是使用OpenGL ES协议的.OpenGL ES是什么呢? OpenGL ES(OpenGl for Embedded System)是OpenGL三维图形API的子集 ...

  2. java生成webservice方法

    参考: https://note.youdao.com/ynoteshare1/index.html?id=c10324bb3b794baece3d2ae9faadc5c1&type=note

  3. Android 使用RadioGroup和RadioButton实现单选效果

    RadioButton和CheckBox的区别:CheckBox选中之后可以直接取消,RadioButton选中之后不能直接取消,所以一般情况下不建议单独使用.1.RadioGroup:RadioBu ...

  4. Oracle12cWindows安装、介绍及简单使用(图文)

    1.下载 地址为:http://www.oracle.com/technetwork/cn/database/enterprise-edition/downloads/index.html 含企业版和 ...

  5. C/C++中的变量和静态变量

    static有两种用法:一是面向过程程序设计语言中的static,用于普通变量和函数,不涉及类:二是面向对象程序设计中的static,主要涉及static在类中的作用. 面向过程设计中的static ...

  6. 解决提示“配色方案已更改为Windows7 Basic”

    WIN7是很多用户都用过的系统,是由微软推出的.下面就说一个小技巧. 如何解决Win7系统提示:“配色方案已更改为Windows 7 Basic”解决方案.   更改Win7配色方案 首先,右击桌面空 ...

  7. MQTT 3.1协议非严肃反思录

    前言 MQTT 3.1协议在弱网络环境下(比如2G/3G等)表现不够好,因此才有了反思. 弱网环境下表现 手机等终端在弱网络环境下丢包情况会非常明显,连接MQTT Server成功率很低.相比单纯的请 ...

  8. LeetCode——Peeking Iterator

    Description: Given an Iterator class interface with methods: next() and hasNext(), design and implem ...

  9. LeetCode——Best Time to Buy and Sell Stock II

    Description: Say you have an array for which the ith element is the price of a given stock on day i. ...

  10. python之xlwt模块列宽width、行高Heights详解

    今天用python操作excel时,发现xlwt的API中没有对width.height有更多介绍,且使用时也不知道width取多少合适.现在这做个详细介绍 使用版本: python:2.7.5 xl ...