微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

(homebrew.mxcl.mysql [2274]):服务无法初始化:无法设置当前工作目录. error = 2:没有这样的文件或目录

如果我在我的mac上运行控制台并转到system.log,我看到该系统,日志充满了这个错误

Oct 31 15:57:59 abhisheks-mbp com.apple.xpc.launchd[1] (homebrew.mxcl.MysqL[2185]): Service Could not initialize: Unable to set current working directory. error = 2: No such file or directory, path = /usr/local/var/MysqL: 17A405: xpcproxy + 11040 [1403][43FABD4F-8081-3087-91BC-95B588688D55]: 0x2
Oct 31 15:57:59 abhisheks-mbp com.apple.xpc.launchd[1] (homebrew.mxcl.MysqL): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Oct 31 15:58:03 abhisheks-mbp com.apple.xpc.launchd[1] (com.apple.preference.displays.Mirrordisplays): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

几个月前我用homebrew安装了MysqL.但我已经删除它我不知道为什么它仍然试图运行它.

我试图删除MysqL

~ > brew uninstall MysqL
Error: No such keg: /usr/local/Cellar/MysqL

但我仍然看到消息涌入.

解决方法:

您可能在过去使用brew服务启动MysqL启用MysqL启动代理并忘记禁用brew服务(在卸载MysqL之前),这将删除plist.

因此,使用以下方法手动卸载并从launchd数据库删除代理:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.MysqL.plist
launchctl remove ~/Library/LaunchAgents/homebrew.mxcl.MysqL.plist

然后删除文件

rm ~/Library/LaunchAgents/homebrew.mxcl.MysqL.plist

如果您执行了plist的自定义安装,则homebrew.mxcl.MysqL.plist文件可能位于/ Library / LaunchAgents中.然后使用相同的命令,但调整上面的路径并添加sudo.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐