And*_*w M 8 postgresql macos pg launchctl
当前正在运行 postgreSQL 9.4.5_2
我试过了
pg_ctl stop -W -t 1 -s -D /usr/local/var/postgres -m f
Run Code Online (Sandbox Code Playgroud)
通常没有消息是好消息,但我会跑后
pg_ctl status -D /usr/local/var/postgres
Run Code Online (Sandbox Code Playgroud)
并得到 pg_ctl: server is running (PID: 536)
我也试过
pg_ctl restart -w -D /usr/local/var/postgres -c -m i
Run Code Online (Sandbox Code Playgroud)
响应消息是:
waiting for server to shut down.......................... failed
pg_ctl: server does not shut down
Run Code Online (Sandbox Code Playgroud)
我还检查了我的 /Library/LaunchDaemons/ 以了解为什么该服务在登录时启动但到目前为止没有运气。有人对我接下来应该检查的地方有任何想法吗?在活动监视器中强制退出也没有帮助我。
lga*_*ini 54
遗憾的是,以前的答案都没有帮助我,它对我有用:
brew services stop postgresql
Run Code Online (Sandbox Code Playgroud)
干杯
And*_*a C 13
遇到了同样的问题,我在本地安装了 postgres,并想将其包装在 docker 容器中。
我通过 1) 卸载 postgres 2) 杀死 postgres 端口上的剩余进程彻底解决了这个问题。如果您不卸载,进程将重新启动并再次获取端口 - 查看您的 Brewfile 表单brew bundle dump
以检查restart_service: true
标志。
我推断,由于我使用的是容器,所以我无论如何都不需要本地容器,但是!!注意,这将从您的系统中删除 postgres。
brew uninstall postgres
...
lsof -i :5432 # this to find the PID for the process
kill - 9 <the PID you found at previous command>
Run Code Online (Sandbox Code Playgroud)
注意:如果您仍然想使用,psql
可以brew install libpq
将 psql 添加到您的 PATH (命令输出显示要添加到您的.zshrc
或类似内容)
试过 sudo 和 su 但没有这样的运气。刚找到这个gui
https://github.com/MaccaTech/postgresql-mac-preferences
如果有人可以帮助使用非常感谢的终端命令,但在那之前 gui 将完成工作。
小智 8
您可以使用此命令停止服务器
{pg_ctl -D /usr/local/var/postgres stop -s -m fast}
Run Code Online (Sandbox Code Playgroud)
小智 5
我尝试了各种选择;最后,下面的命令有效。
sudo -u postgres ./pg_ctl -D /your/data/directory/path stop
Run Code Online (Sandbox Code Playgroud)
例子
sudo -u postgres ./pg_ctl -D /Library/PostgreSQL/11/data stop
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
19467 次 |
最近记录: |