无法在 Mac OS 中启动时加载 postgresql
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26334414/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't make postgresql load at startup in Mac OS
提问by Ha Pham
I have installed postgresql
via HomeBrew
. It worked but today I find that postgresql
server does not run when computer start.
我已经postgresql
通过HomeBrew
. 它有效,但今天我发现postgresql
计算机启动时服务器没有运行。
I try to use launchctl
to load it again with below command:
我尝试使用launchctl
以下命令再次加载它:
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
and I see the message:
我看到消息:
/usr/local/Cellar/postgresql/9.3.4/homebrew.mxcl.postgresql.plist: Service is disabled
I do not know how to enable postgresql service. Could anyone show me?
我不知道如何启用 postgresql 服务。谁能给我看看?
回答by Parag Bafna
Use -w
option with launchctl
.
将-w
选项与launchctl
.
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
-w
Overrides the Disabled key and sets it to false.
-w
覆盖 Disabled 键并将其设置为 false。
回答by KARASZI István
The new way as brew info postgresql
says:
新方法如brew info postgresql
说:
brew services start postgresql
回答by gards
It might also be helpful to use the command brew info postgresql
for suggestions about how to set up your database and move the plist file into ~/Library/LaunchAgents
使用该命令brew info postgresql
获取有关如何设置数据库并将 plist 文件移入的建议也可能会有所帮助~/Library/LaunchAgents