我使用brew安装了mysql@5.7。安装之后,我使用brew services start mysql@5.7启动了服务。使用brew services进行检查显示其工作良好。
但是,在第一次之后的任何尝试中,行为都是不同的。我运行brew services start mysql@5.7,我得到:
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/505 /Users/Mahmoud/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist` exited with 5.如果我尝试重新启动服务,使用brew services restart mysql@5.7,我将获得
Stopping `mysql@5.7`... (might take a while)
==> Successfully stopped `mysql@5.7` (label: homebrew.mxcl.mysql@5.7)
==> Successfully started `mysql@5.7` (label: homebrew.mxcl.mysql@5.7)但是使用brew services进行的检查将显示服务已经停止:
Name Status User File
mysql@5.7 stopped root ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist使用brew services stop mysql@5.7手动停止服务并重新启动服务也不起作用。
还试着用brew uninstall mysql@5.7卸载,用brew install mysql@5.7重新安装,但问题依然存在。我试着四处看看,但没有人有同样的问题。有什么办法解决这个问题吗?
发布于 2022-02-13 15:32:46
我今天也遇到了同样的问题,我注意到我已经在/usr/local/var/mysql/目录中获得了数据,可能是以前安装的数据。
我不关心目录中的任何丢失,所以我删除了所有的rm -rf /usr/local/var/mysql,运行了brew uninstall mysql@5.7和brew install mysql@5.7。
当我下一次检查brew services list时,它已经在运行了,这是以前没有发生过的事情,而且都在工作。
发布于 2022-07-14 17:49:41
环境: M1 MPB,OSX12.4
花了整整一天的时间,终于找到了一个有效的解决方案。
使用brew services stop mysql@5.7停止服务
删除启动代理文件rm ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
如果服务是链接brew unlink mysql@5.7,则取消它的链接
卸载服务brew uninstall mysql@5.7
然后,我删除了上面建议的mysql数据目录。这不是我机器上的/usr/local/var/mysql,而是/opt/homebrew/var/mysql
所以rm -rf /opt/homebrew/var/mysql
这不是我的最后一步。此时重新安装给了我一些错误,brew post安装步骤失败了。大多数错误指向我的my.cnf文件。我发现在尝试重新安装之前删除此文件可以防止这些错误。
我备份了这个文件,以防引起更多问题。
cp /opt/homebrew/etc/my.cnf /opt/homebrew/etc/my.cnf.backup
那么,rm /opt/homebrew/etc/my.cnf
注意:此文件可能位于计算机上的另一个位置。
好的,现在重新安装。
brew install mysql@5.7
brew link mysql@5.7 --force
如果链接包,可以按照brew日志建议将其添加到路径中。因此,添加,export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"到您的~/.zshrc。
验证brew services list或brew services是否可用该服务。
如果您在那里看到mysql@5.7,可以使用brew services start mysql@5.7启动它
发布于 2022-06-04 12:33:42
下面是我后来在brew中发现的一个关键问题。
正如上面brew services所示,用户是根用户,而不是当前用户。这是一个疯狂的问题,也是造成这个问题的主要原因。解决办法是:
sudo subrew services您应该发现taht服务属于rootbrew stop mysql@5.7 brew uninstall mysql@5.7 --基本上卸载mysql@5.7以便根userexit返回到user.brew install mysql@5.7现在,服务的所有者是当前的用户,并告别brew的疯狂行为。
https://stackoverflow.com/questions/70447598
复制相似问题