pg_ctl启动数据库命令:

使用 pg_ctl 命令
检查其状态:
在这里插入图片描述

pg_ctl 命令为 PostgreSQL 服务端应用程序,可以用来初始化,启动和停止及控制 PostgreSQL 服务器。

pg_ctl 语法格式:

初始化数据库

pg_ctl init[db]   [-D DATADIR] [-s] [-o OPTIONS]

启动数据库

pg_ctl start      [-D DATADIR] [-l FILENAME] [-W] [-t SECS] [-s] [-o OPTIONS] [-p PATH] [-c]

关闭数据库

pg_ctl stop       [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s]

重启数据库

pg_ctl restart    [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s] [-o OPTIONS] [-c]

重新加载 postgresql.conf 或 pg_hba.conf 文件

pg_ctl reload     [-D DATADIR] [-s]

查看服务器是否在指定的数据目录运行

pg_ctl status     [-D DATADIR]
pg_ctl promote    [-D DATADIR] [-W] [-t SECS] [-s]
pg_ctl logrotate  [-D DATADIR] [-s]
pg_ctl kill       SIGNALNAME PID

参考链接

http://www.siyueweb.cn/index.php?c=show&id=218
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐