PostgreSQL-pg_ctl
命令简介
pg_ctl 启动、关闭、重启 postgres
pg_ctl start [-w] [-s] [-D datadir] [-l filename] [-o options] [-p path]
pg_ctl stop [-W] [-s] [-D datadir] [-m s[mart] | f[ast] | i[mmediate] ]
pg_ctl restart [-w] [-s] [-D datadir] [-m s[mart] | f[ast] | i[mmediate] ] [-o options]
pg_ctl reload [-s] [-D datadir]
pg_ctl status [-D datadir]
pg_ctl kill [signal_name] [process_id]
pg_ctl register [-N servicename] [-U username] [-P password] [-D datadir] [-w] [-o options]
pg_ctl unregister [-N servicename]
具体说明见参考资料。
实操记录
# 查找 pg_ctl
[root@localhost ~]# whereis pg_ctl
pg_ctl: /usr/bin/pg_ctl /usr/share/man/man1/pg_ctl.1.gz # 启动 postgres
[root@localhost ~]# su postgres
bash-4.2$ /usr/bin/pg_ctl -D /var/lib/pgsql/data start
could not change directory to "/root"
pg_ctl: another server might be running; trying to start server anyway
server starting
bash-4.2$ FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 30063) running in data directory "/var/lib/pgsql/data"?
出现如下错误 could not change directory to "/root",因为在 postgres 中不能自动切换路径,解决方法
bash-4.2$ cd /usr/bin
bash-4.2$ pwd
/usr/bin
bash-4.2$ ./pg_ctl -D /var/lib/pgsql/data start
server starting
可能出现如下错误 pg_ctl: PID file "/var/lib/pgsql/data/postmaster.pid" does not exist,可以查看启动日志
我操作时是因为磁盘满了,无法创建新的文件 postmaster.pid,清除缓存腾出一点空间即可。
PostgreSQL-pg_ctl的更多相关文章
- PostgreSQL的xlog实验一
磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面: PostgreSQL基础知识与基本操作索引页 回到顶级页面:PostgreSQL索引页 一,从initdb开始,initdb执行结束 ...
- PostgreSQL与MySQL常用命令比较[转]
PostgreSQL与MySQL常用命令比较 原文链接: http://www.phpwell.com/?p=174 PostgreSQL MySQL 服务启动:1)#service postgres ...
- PostgreSQL编译安装
PostgreSQL编译安装 安装语言包 ### PostgreSQL 初始化过程中,会读取操作系统字符编码, ### 若程序需要使用zh_CN.utf-8字符编码,需要在PostgreSQL 初始化 ...
- mongoDB BI 分析利器 - PostgreSQL FDW (MongoDB Connector for BI)
背景 mongoDB是近几年迅速崛起的一种文档型数据库,广泛应用于对事务无要求,但是要求较好的开发灵活性,扩展弹性的领域,. 随着企业对数据挖掘需求的增加,用户可能会对存储在mongo中的数据有挖掘需 ...
- Mysql与Postgresql常用命令比较
PostgreSQL MySQL 服务启动:1)#service postgresql start2)#/etc/init.d/postgresql start3)#su – postgresql$p ...
- Windows安装PostgreSQL解压版
PostgreSQL下载地址:https://www.enterprisedb.com/downloads/postgres-postgresql-downloads windows版,务必装在C盘! ...
- pg_ctl -- 启动、停止、重启 PostgreSQL
pg_ctl 名称 pg_ctl -- 启动.停止.重启 PostgreSQL 语法 pg_ctl start [-w] [-s] [-D datadir] [-l filename] [-o opt ...
- pg_ctl — 启动、停止、重启 PostgreSQL
pg_ctl 名称 pg_ctl -- 启动.停止.重启 PostgreSQL 语法 pg_ctl start [-w] [-s] [-D datadir] [-l filename] [-o opt ...
- pg_ctl - 启动,停止和重启 PostgreSQL 服务器
SYNOPSIS pg_ctl start [ -w ] [ -s ] [ -D datadir] [ -l filename] [ -o options] [ -p path] pg_ctl sto ...
- CentOS7下安装并简单设置PostgreSQL笔记
为什么是PostgreSQL? 在.NET Core诞生之前,微软平台上最常见的开发组件便是.NET Framework + SQL Server了,但是现在.NET Core终于让跨平台部署成为了现 ...
随机推荐
- Unity3D_(数据)JsonUtility创建和解析Json
Json 百度百科:传送门 LitJson创建和解析Json 传送门 Json数据解析在Unity3d中的应用 传送门 一.使用JsonUnity创建Json using System.Collect ...
- 大哥带的XSS练习LEVE2
0X01输出在html标签中的XSS 这里相当于我们把XSS代码插入到了 html中的<td>标签中 其他好看的 但是不是同源访问 <script> var body= doc ...
- sqli-labs(5)
双查询注入 0x01爱之初了解 在第一次接触到双查询注入时 肯定会有很多问题 在这里我们先了解一下什么叫做 双查询注入 他的语法结构 以及为什么这样构造 答:在此之前,我们理解一下子查询,查询的关键字 ...
- Concurrent包里的其他东西:ArrayBlockingQueue、CountDownLatch等等。
1:本例介绍一个特殊的队列:BlockingQueue,如果BlockingQueue是空的,从BlockingQueue取东西的操作将会被阻断进入等待状态,直到BlockingQueue进了东西才会 ...
- C++入门经典-例2.3-在print函数中使用附加符号
1:代码如下: // 2.3.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" int main() { ; /*定义长整型变量,为其赋值*/ ...
- Java期末课程学习汇总。
本学期面向对象与Java程序设计课程已经结束了,给自己学习来个总结. 本学期过的非常快,不得不说这一学期学到的东西很少,感觉自己的进步很小. 而且感觉自己总少了点什么,在写这篇总结前,我认真想了,很多 ...
- 排序算法总结(java实现)
排序算法 介绍:排序分为内部排序和外部排序,内部排序指在内存中进行的排序过程:外部排序指在外存中进行排序的过程,但是此过程建立在多次访问内存的基础上(分成一段段利用内部排序进行排序). 以下排序均属于 ...
- snmpEngineBoots & snmpEngineID数据存储到非易失性存储设备
#include <stdio.h> #include <stdlib.h> #include <string.h> int regenerateID() { ; ...
- Dubbo Configuration
可配置参数 http://dubbo.apache.org/zh-cn/docs/user/references/xml/introduction.html 与 spring 整合的几种方式 Spri ...
- 自动化框架Quantum Automation Framework+cucumber+perfecto
名词解释 Quantum: 一款基于JAVA的自动化框架,支持手机和桌面WEB的自动化测试.与cucumber和perfecto实现了整合,用于BDD自动化. Refer: http://projec ...