执行命令

Yum install postgresql-server

Yum install postgresql-contrib

安装完成后,检查postgresql的服务状态

Systemctl status postgresql

服务未启动

执行systemctl start postgresql启动服务

执行过程有可能会报错

Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.

安装postgresql后需要初始化数据库

执行postgresql-setup initdb

再次启动postgresql服务

用ps命令查看postgresql进程信息

用su – postgres切换到postgresql用户执行psql的操作

使用\l查看postgresql的所有数据库信息

到此可以看到postgresql已正确安装。为了以后每次开机可以启动postgresql,执行如下命令

到此postgresql基本的安装和配置完成。

更多文章关注微信公众号“挨踢学霸”

CentOS7安装Postgresql的更多相关文章

  1. Centos7安装 PostgreSQL步骤

    1. 安装服务器即可. Yum install postgresql-server Yum install postgresql-contrib 2. 验证是否安装成功: rpm -aq| grep ...

  2. 阿里云ecs centos7安装 postgresql 9.4

    rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm yum insta ...

  3. centos7 安装 PostgreSql

    确定你是管理员,然后运行命令: yum -y install postgresql-server postgresql-contrib 初始化数据库 postgresql-setup initdb 启 ...

  4. CentOS7 安装Postgresql 11+ 源码编译安装Postgis-2.5.2

    ####安装Postgresql-11yum install zlib-devel gcc makegroupadd postgresuseradd -g postgres postgrespassw ...

  5. centos7安装postgresql和postgis

    1.安装步骤 -- 安装对应的rpm文件(其他系统的rpm包,请自行到https://yum.postgresql.org/下载)yum install -y https://download.pos ...

  6. Centos7 源码安装PostgreSQL Citus集群 (转载)

    citus的分布式集群目前在苏宁大规模应用,苏宁陈华军也做了很多技术分享和博客介绍.目前所有的教程都是rpm和pg一起安装,个人不喜欢,毕竟citus定位是个插件,我想在我已安装的pg上源码装一个ci ...

  7. CentOS7安装配置Bacula yum方法

    参考: https://www.baidu.com/link?url=o2QIy2YZWjsJPAFJuYFhrH3nPvtyRkSe-o5Q_FqFZ5E1EMOsIOmGeKm0HAonwHOw8 ...

  8. centos7 安装配置postgresql

    考:https://www.linuxidc.com/Linux/2017-10/147536.htm http://blog.51cto.com/12482328/2090844 https://w ...

  9. 19.CentOS7下PostgreSQL安装过程

    CentOS7下PostgreSQL安装过程 装包 sudo yum install postgresql-server postgresql-contrib 说明: 这种方式直接明了,其他方法也可以 ...

随机推荐

  1. 追溯 React Hot Loader 的实现

    文:萝卜(沪江金融前端开发工程师) 本文原创,转载请注明作者及出处 如果你使用 React ,你可以在各个工程里面看到 Dan Abramov 的身影.他于 2015 年加入 facebook,是 R ...

  2. 使用sql语句获取数据库表的信息

    下面的sql语句可以查看表的信息.其中modify_date和create_date可以根据表的修改时间来查看.如果不需要删除后,就能看到所有表的字段信息 ) PERCENT d.name AS 表名 ...

  3. win7 vs2012+wdk8.0 搭建wdf驱动开发环境

    开发环境搭建:系统:win7 x64工具:vs2012 + WDK8.0插件:wdfcoinstaller.msi(1)先安装vs2012,再安装wdk8.0,这样在打开vs2012时可以创建wind ...

  4. BIOS中的UEFI和Legacy启动模式

    BIOS即Basic Input/Output System,翻成中文是"基本输入/输出系统",是一种所谓的"固件",负责在开机时做硬件启动和检测等工作,并且担 ...

  5. freemarker报错之十五

    1.错误描述 六月 04, 2014 11:04:03 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  6. (二十七)mongodb操作学习

    在不使用mongodbVUE图形界面工具的情况下,打开数据库和集合后,如果要:    插入一条字段名为name,内容为java的记录,可以写成x={name:"java"};,然后 ...

  7. java重写和重载

    方法的重载: 在一个类中的两个或两个以上的方法,他们方法名相同但是参数列表不同,这种方式称为方法的重载,方法的重载是实现多态性的方式之一. 参数列表不同指的是参数的个数不同或相同的个数但顺序不同或者类 ...

  8. mobile开发中常用的css

    1. viewport: 也就是可视区域.对于桌面浏览器,我们都很清楚viewport是什么,就是出去了所有工具栏.状态栏.滚动条等等之后用于看网页的区域, 这是真正有效的区域.由于移动设备屏幕宽度不 ...

  9. Modbus总结

    1.概念 ①Coil和Register Modbus中定义的两种数据类型.Coil是位(bit)变量:Register是整型(Word,即16-bit)变量. ②Slave和Master与Server ...

  10. ubuntu安装latex

    1 终端中输入"sudo apt-get install texlive-full",输入root密码. 若不想安装所有文件,可以选择"sudo apt-get inst ...