brew链接mysql没有完成

由于某些原因brew不链接MySQL,它抱怨权限。 我chmod该文件夹到777但我仍然有相同的问题

  laptop$ brew install mysql 

错误:

  mysql-5.5.27 already installed, it's just not linked laptop$ brew link mysql Linking /usr/local/Cellar/mysql/5.5.27... Warning: Could not link mysql. 

取消链接…

  Error: Could not symlink file: /usr/local/Cellar/mysql/5.5.27/lib/plugin /usr/local/lib is not writable. You should change its permissions. 

我想到了什么问题。 这是与权力的问题,我基本上这样做

 sudo chown -R $(whoami) /usr/local/lib/ 

我相信你应该:

 sudo chmod 775 /usr/local/lib/ 

并确保您是文件组的成员。

不是一个真正的答案,而是一个评论,可能会帮助那些把头发弄得乱七八糟的人变得疯狂,而且在连接时仍然会有“不可写”的错误。 例如,从$ brew doctor -d

 Error: /usr/local/lib/pkgconfig isn't writable. This can happen if you "sudo make install" software that isn't managed by by Homebrew. If a formula tries to write a file to this directory, the install will fail during the link step. 

我build议你检查链接文件和它的依赖关系,并删除它们并通过自制软件重新安装,或者安装软件包而不使用自制软件。