PostgreSQL 12 YUM安装
这篇文档,只是为了初次体验一下PostgreSQL 12
。对于
PG有一个感观上面的认识。
1.创建postgres用户
groupadd postgres
useradd -g postgres postgres
2.查看操作系统版本
[root@db ~]# cat /etc/issue.bak
CentOS release 6.9 (Final)
Kernel \r on an \m
3.配置yum源(对应CentOS 6)
参考文档:https://www.postgresql.org/download/linux/redhat/
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-
repo-latest.noarch.rpm
4.安装客户端包
yum install postgresql12
5.安装服务器端包
yum install postgresql12-server
6.初始化数据库和设置自启动服务
service postgresql-12 initdb
chkconfig postgresql-12 on
service postgresql-12 start
7.postgres用户的bash_profile
在/home/postgres/.bash_profile中。添加如下:
PG_BIN=/usr/pgsql-12/bin
export PG_BIN
生效
source /home/postgres/.bash_profile
------------------邪恶的分割线---------------------
PG的启停服务
从pg的启动日志/var/lib/pgsql/12/pgstartup.log
来分析:
- 其数据目录是
/var/lib/pgsql/12/data
- 其二进制目录是
/usr/pgsql-12/bin/
通过ps -ef 可以看到pg是通过postmaster进程,来推动pg的运行。如下:
[root@db data]# ps -ef |grep pg
postgres 14917 1 0 10:30 ? 00:00:00 /usr/pgsql-12/bin/postmaster -D
/var/lib/pgsql/12/data
root 15042 14534 0 10:35 pts/0 00:00:00 grep pg
自启动的方式启停pg服务
[root@db 12]# service postgresql-12 restart
Stopping postgresql-12 service: [ OK ]
Starting postgresql-12 service: [ OK ]
[root@db 12]# service postgresql-12 stop
Stopping postgresql-12 service: [ OK ]
[root@db 12]# service postgresql-12 start
Starting postgresql-12 service: [ OK ]
使用pg_ctl
,启停pg的服务
关闭服务
[root@db 12]# su postgres -c '/usr/pgsql-12/bin/pg_ctl stop -D /var/lib/pgsql/12/data/ -l zsdpglog'
启动服务
[root@db 12]# su postgres -c '/usr/pgsql-12/bin/pg_ctl start -D /var/lib/pgsql/12/data/ -l zsdpglog'
使用postgres
,启动pg的服务
[postgres@db bin]$ ./postgres -D /var/lib/pgsql/12/data/ > /home/postgres/zsdstartupPg.log 2>&1 &
如何使用和管理pg的启停服务,看个人喜好。
PostgreSQL 12 YUM安装的更多相关文章
- PostgreSQL 之 yum安装 postgis 插件
版本说明: CentOS7.5 + PostgreSQL 10.5 参考资源: https://www.postgresql.org/download/linux/redhat/ http://dow ...
- CentOS7 源码安装 PostgreSQL 12
PostgreSQL 12 源码安装 Table of Contents 1. 下载 2. 准备环境 3. 编译安装 4. 设置环境变量 5. 初始化数据库 6. 配置参数文件 6.1. postgr ...
- 与你相遇好幸运,CentOS 7 x86_64使用Yum安装PostgreSQL
访问http://yum.pgrpms.org/reporpms/repoview/letter_p.group.html,下载并安装和当前系统对应的rpm文件. wget https://downl ...
- postgresql数据库的yum安装方法
实验环境>>>>>>>>>>>>>>>>>>操作系统:CentOS release 6.3 ...
- CentOS 7 yum安装nginx-1.12.0
CentOS 7 中的 yum 没法直接使用 yum install nginx 这个指令去安装nginx,因为nginx这个服务不是yum库中自带的.图1是官方提供的大致安装步骤,图2是官网提供的多 ...
- CentOS7 yum安装、配置PostgreSQL 9.5
PostgreSQL 9.5安装 1.添加RPM yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7 ...
- yum安装PostgreSQL 在6和7
一.安装PostgreSQL 复制代码// 安装EPEL源# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.n ...
- CentOS7使用yum安装PostgreSQL和PostGIS
更新yum源 CentOS7默认yum源的PostgreSQL版本过低,不适合在本版本上使用.在https://yum.postgresql.org/repopackages.php上找到适合Cent ...
- CentOS下yum安装PostgreSQL
关键词:centos install PostgreSQL Configure YUM repository vim /etc/yum.repos.d/CentOS-Base.repo [base] ...
随机推荐
- MASMPlus连接出错:error LNK2001: unresolved external symbol _WinMainCRTStartup
坑:汇编语言第三版使用的是masm5.0,网上找到了一个masm32,一看名字,不就是masm的32位版本吗.然也..这是另外一个软件 MASM32并非是指Microsoft的MASM宏汇编器.MAS ...
- FreeHttp1.2升级说明
一.升级方法 下载新版本插件 https://files.cnblogs.com/files/lulianqi/FreeHttp1.2.zip 或 http://lulianqi.com/file/ ...
- 如何封装$on,$emit,$off——学vue前你必须懂得封装!
let evevtListenr = {} 封装$on const $on = (eventName,cb)=>{ if(!evevtListenr[eventName]){ ...
- mysql 数据误删恢复
当binlog_format设置为ROW时,想查看binlog中的sql语句时,需要解密,添加这个 --base64-output=decode-rows -v
- C# loop executed one by one wait the former completed
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- goweb-搭建服务
web应用简介 Web 应用在我们的生活中无处不在.看看我们日常使用的各个应用程序,它们要 么是 Web 应用,要么是移动 App 这类 Web 应用的变种.无论哪一种编程语言,只要 它能够开发出与人 ...
- GO语言介绍以及开发环境配置
一.介绍 GO语言是静态强类型语言 静态也就是编译型语言 二.安装 1.下载地址 下载地址 https://golang.google.cn/dl/ 2.安装 Linux安装 1.下载二进制包:go1 ...
- 剑指offer笔记面试题13----机器人的运动范围
题目:地上有一个m行n列的方格.一个机器人从坐标(0, 0)的格子开始移动,它每次可以向左.右.上.下移动一格,但不能进入行坐标和列坐标的数位之和大于k的格子.例如,当k为18时,机器人能够进入方格( ...
- angularjs实现购物车批量删除,filter模糊查询,排序
数据源 $scope.data=[ {num:1234,name:"ipad",price:3400.00,count:10}, {num:1235,name:"ipho ...
- 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.
运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...