关键词:centos install PostgreSQL

Configure YUM repository

vim /etc/yum.repos.d/CentOS-Base.repo 

[base] and [updates] sections添加:

exclude=postgresql* 

Install PGDG RPM file

go http://yum.postgresql.org and find your correct RPM.

For example, to install PostgreSQL 9.3 on CentOS 6 64-bit:

打开 http://yum.postgresql.org/repopackages.php#pg93 后找到CentOS 6 - x86_64

then:

yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm

Install PostgreSQL

list available packages:

yum list postgres* 

For example, to install a basic PostgreSQL 9.3 server:

yum install postgresql93-server 
yum install postgresql96-server

Other packages can be installed according to your needs.

配置

After installing the packages, a database needs to be initialized and configured.

PostgreSQL data directory(/var/lib/pgsql/9.3/data) contains all of the data files for the database.

[编辑]Initialize

The first command (only needed once) is to initialize the database:

service postgresql-9.3 initdb
正在初始化数据库:                                         [确定] 
/usr/pgsql-9.6/bin/postgresql96-setup initdb

报错:

postgresql96-setup initdb
Failed to get D-Bus connection: Operation not permitted
you're running a non-privileged container.
还是别在docker里面玩了!
docker run -d -e "container=docker" --privileged=true -v /sys/fs/cgroup:/sys/fs/cgroup --name pgsql centos /usr/sbin/init
docker exec -it pgsql /bin/bash

[编辑]Startup

开机启动:

chkconfig postgresql-9.3 on
service postgresql-9.3 start 

centos7:
 systemctl enable postgresql-9.6.service
 systemctl start postgresql-9.6.service


[编辑]艺搜参考

https://wiki.postgresql.org/wiki/YUM_Installation

CentOS下yum安装PostgreSQL的更多相关文章

  1. centOS下yum安装配置samba

     centOS下yum安装配置samba 2010-03-29 15:46:00 标签:samba yum centOS 安装 休闲 注意:本文的原则是只将文件共享应用于内网服务器,并让将要被共享的目 ...

  2. centos下yum安装crontab+mysql自动备份

    参考博文: centos下yum安装crontab yum install vixie-cron crontabs      //安装 chkconfig crond on               ...

  3. [转载]centos下yum安装samba及配置

    centos下yum安装samba及配置 在我们使用 Windows 作为客户机的时候,通常有文件.打印共享的需求.作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过Wind ...

  4. centos下yum安装lamp和lnmp轻松搞定

    centos下yum安装lamp和lnmp轻松搞定.究竟多轻松你看就知道了.妈妈再也不操心不会装lamp了. 非常辛苦整理的安装方法,会持续更新下去.凡无法安装的在评论里贴出问题来,会尽快解决.共同维 ...

  5. centos 下yum 安装nginx

    centos 下yum 安装nginx 1. 直接yum install nginx不行,要先处理下源: rpm -ivh http://nginx.org/packages/centos/6/noa ...

  6. CentOS下yum安装FFmpeg

    一.yum安装FFmpeg 1.    最偷懒的方式就是yum安装了,自动解决依赖.不过CentOS系统默认无FFmpeg源,企业版 Linux 附加软件包EPEL源也不包含,需要手动添加yum源配置 ...

  7. CentOS下yum安装

    centos最小化安装不会装yum,以下是安装方法:(所有操作均在ROOT用户下,系统版本是centos7) 一.删除原有YUM # rpm -aq|grep yum|xargs rpm -e --n ...

  8. Python - CentOS 下 yum 安装 python3

    1. 概述 CentOS 7 自带 python2(python 以下正文简写为 py, 命令行中依然是 python) 尝试用 yum 安装 py3 2. 环境 os centos7 3. 步骤 1 ...

  9. CentOS下yum安装LAMP

    1. 用yum安装Apache,Mysql,PHP. 1.1安装Apache yum install httpd httpd-devel 安装完成后,用/etc/init.d/httpd start  ...

随机推荐

  1. (回溯法)数组中和为S的N个数

    Given a list of numbers, find the number of tuples of size N that add to S. for example in the list ...

  2. ASP.NET找不到类型或命名空间名称怎么办

    如图所示,运行之后提示找不到类型或空间名称,右击有波浪线的代码,选择解析,using XXX   随后自动补上了程序集引用

  3. AVAudioPlayer播放在线音频文件

    AVAudioPlayer播放在线音频文件 一:原里: AVAudioPlayer是不支持播放在线音频的,但是AVAudioPlayer有一个 initWithData的方法:我们可以把在线音频转换为 ...

  4. Linux dig

    安装dig: yum install bind-utils dig 常用命令: # dig 最基本的用法dig @server sina.com.cn. # 用 dig 查看 zone 数据传输 di ...

  5. Hibernate持久化对象的状态

    1. 站在持久化的角度 , Hibernate 把对象分为 4 种状态 : 持久化状态, 暂时状态, 游离状态(脱管状态) , 删除状态.Session 的特定方法能使对象从一个状态转换到还有一个状态 ...

  6. 〖C语言〗C语言一个函数传递无限制多参数(不确定参数函数)的方法

    /* * ===================================================================================== * * Filen ...

  7. Android体系架构详解

    Andriod是什么? 首先,就像Android开源和兼容性技术负责人Dan Morrill在Android开发手册兼容性部分所解释的,“Android并不是传统的Linux风格的一个规范或分发版本, ...

  8. 监听OSGi服务

    方法一:实现ServiceListener接口: package org.riawork.demo.web; import org.osgi.framework.BundleActivator; im ...

  9. AndroidStudio调用so文件

    将*.so文件拷贝到app\libs\armeabi文件夹下 修改build.gradle文件,在buildTypes下添加 sourceSets { main { jniLibs.srcDirs = ...

  10. 使用spring AOP获得session的思路

    由于Spring 的AOP面向切面编程,与Servlet容器没有任何关联,所以想要获得Session会话比较麻烦. 当然Struts2同样不依赖Servlet容器,可以在Spring AOP中可以使用 ...