37

For some some reason brew does not link mysql and it complains about permission. I chmod the folder to 777 but I am still having the same issues

 laptop$ brew install mysql 

Error:

 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. 

Unlinking...

 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. 
3
  • can u please update info abt your environment ? Commented Oct 10, 2012 at 5:49
  • I would think that people would know it is a mac because I am using the brew install... Commented Oct 10, 2012 at 11:15
  • Thaks for your info :) i'm not much aware abt mac will try to help you Commented Oct 10, 2012 at 11:20

5 Answers 5

99

I figured what the problem was. It was issues with premission and I basically did this

sudo chown -R $(whoami) /usr/local/lib/ 
Sign up to request clarification or add additional context in comments.

1 Comment

Wow - I wish I found this earlier... thank you SO MUCH!
1

I believe You should:

sudo chmod 775 /usr/local/lib/ 

and make sure You are member of the file's group.

Comments

1

Not really an answer, but a comment that may help those who are pulling out hair chowning and chmoding like crazy and still getting "not writeable" errors at linking. For example, from $ 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. 

I suggest you check the linked file and it's dependencies and either delete them and reinstall via homebrew, or install the package without using homebrew.

Comments

1

In my system this worked perfectly.

chown -R $(whoami) /usr/local/share/ 

Comments

0

I am trying to give a general answer to the question. It happens that neither /usr/local/lib/ nor /usr/local/share/ gives error. You should look the exact directory that is not writable. It is mentioned right after "Error: Could not symlink". So execute the command for that directory.

chown -R $(whoami) [/bath/to/your/dir] 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.