我正在运行服务器版本:5.7.16 Homebrew。我试过了
sudo launchctl unload -F ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
但收到错误消息
/usr/local/Cellar/mysql/5.7.16/homebrew.mxcl.mysql.plist: Could not find specified service
谷歌搜索无法正常工作,因为有数百万个答案,但没有一个能够正常运作。
这是对OSX的请求。不是ubuntu。
答案 0 :(得分:1)
对于Homebrew,他们建议
brew services restart mysql
此处:https://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew
答案 1 :(得分:1)
听起来你的工作正常,但只是为了记录,我很确定答案是:不要使用sudo
。以root身份运行launchctl
时,它会管理启动守护程序,而不是启动代理程序;你在〜/ Library / LaunchAgents中有mysql .plist,所以它是一个每用户启动代理,而不是一个启动守护进程,因此你必须在你的用户ID下运行launchctl
(不是 root)以便管理它。