我是sql的新用户,在Mac上使用本地服务器时遇到问题。 首先,我想停止使用服务器
pg_ctl -D /usr/local/var/postgres stop
但是bash会返回这样的问题:
waiting for server to shut
down...............................................................
failed
pg_ctl: server does not shut down
我尝试使用
brew services restart postgresql
此后,我使用
pg_ctl -D /usr/local/var/postgres status
bash也返回
pg_ctl: server is running (PID: 3036)
如何停止?谢谢。
答案 0 :(得分:3)
尝试强制使用“快速”模式,这有点不礼貌,但要注意的是,它将跳过一些与更礼貌的关机有关的手续。
pg_ctl stop -m fast -D /usr/local/var/postgres
根据文档:
Options for stop or restart:
-m, --mode=MODE MODE can be "smart", "fast", or "immediate"
Shutdown modes are:
smart quit after all clients have disconnected
fast quit directly, with proper shutdown
immediate quit without complete shutdown; will lead to recovery on restart