详解PostgreSQL启动停止命令(重启)

bangongJIAO1@c 发布于 2025-11-27 阅读(2)

1.先查看是否有postgresql服务

[root@os bin]# cd /usr/lib/systemd/system
[root@os system]# ls

详解PostgreSQL启动停止命令(重启)

记住这个!

2. 关闭服务

systemctl stop postgresql-9.5.service

3.启动服务

systemctl start postgresql-9.5.service

一开始想用pg_ctl 去操作的,但是需要其他用户去操作,不能使用超级管理员,嫌麻烦,直接这样重启吧