Warning the user/local/mysql/data directory is not owned by the mysql user
42,146
Solution 1
If you can't start mysql service in snow leopard, and in the panel prefs appears 'warning the user/local/mysql/data directory is not owned by the mysql user', you have to:
sudo chown -RL root:mysql /usr/local/mysql
sudo chown -RL mysql:mysql /usr/local/mysql/data
sudo /usr/local/mysql/support-files/mysql.server start
Solution 2
This work for me in El Capitan & Sierra
sudo chown -R _mysql:wheel /usr/local/mysql/data
That's it.
Update: to fix auto start
I found it more useful if you fix Auto Starting too:
sudo nano /Library/LaunchDaemons/com.mysql.mysql.plist
And paste in:
<!--?xml version="1.0" encoding="UTF-8"?-->
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true />
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<string>--user=mysql</string>
</array>
</dict>
</plist>
Save it and then:
sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist
sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
Then it will load on a restart.
Reference: https://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/
Related videos on Youtube
Author by
Kronos
Updated on November 08, 2020Comments
-
Kronos over 3 years
I can't start the mysql service in Snow Leopard, and in the panel prefs appears the message,
warning the user/local/mysql/data directory is not owned by the mysql user
How can I fix this?
-
Scott over 11 yearsThank you. Whether it's a question or not, it solved the issue for me.
-
joemar.ct over 11 yearsI had the same problem in Mountain Lion, this worked for me.
-
Henley over 11 yearsWho cares if it's not a question. It worked. +10000000 points.
-
callum over 11 yearsThis solved my problem, but I think it's a disgrace that @Kronos tried to use SO to be helpful in the wrong format. An absolute disgrace. This blatant disregard for the Q&A format could permanently destabilise this community. To the administrators who closed this thread: keep fighting the good fight. I believe in you.
-
Chris Craft almost 11 yearsWell Jeff Atwood the creator of the site says "It’s OK to Ask and Answer Your Own Questions", blog.stackoverflow.com/2011/07/… and searches on Google are pretty much coming here for the answer as well.
-
Josh over 10 years+1 as it worked for me. I do agree with both Chris and callum at the same time. As the article that Chris pointed out, it IS okay to answer your own QUESTION. The point is here there is no question to answer, just the answer. It would've been better if he would've asked the question, then answered it.
-
Julia Zhao almost 10 yearsI had the same problem in Mavericks. The suggested commands worked for me. Thanks!
-
monal86 almost 10 yearsThanks so much! I was struggling to fix my issue and this was a life saver!!
-
Nirmal Ram over 9 yearsThanks, You saved my day.
-
-
Shog9 over 9 yearsApparently this is still biting people - so I've moved your answer into an... Answer. Hope you don't mind...
-
John Ruddell over 8 yearsfor others coming to this now.. this works in El Capitan as well
-
zeros-and-ones over 8 yearsWhy hasn't this been checked as the correct answer?
-
albertski over 8 yearsI couldn't get mysql to start after upgrading to El Capitan. This worked for me.
-
Joshua Pinter about 8 years@zeros-ones Because the OP originally answered it in the question itself and an admin (@Shog9) moved it to an answer. The OP needs to mark it as the correct answer now.
-
craigmiller160 about 8 yearsis wheel your own user name, or something special? If that could be clarified that would be great
-
Ihab Shoully about 8 years
Wheel
is (Unix term) refers to a user account with a wheel bit. -
saq7 over 7 yearsThis fixed it in Sierra, as well.
-
lewis over 7 yearsThis randomly started happening to me on Sierra (weeks after updating). Fix still works
-
Dave Nottage almost 7 yearsSeriously.. does this happen after every macOS update??
-
Feras about 6 yearsit's working, You save my time on macOS Hight Sierra, Yes @DaveNottage this happened after Sierra update
-
Joshua Pinter over 5 yearsTried this on macOS Mojave and no joy. I get
ERROR! The server quit without updating PID file
when tryingmysql.server start
-
Nick Lee about 5 yearsWhat is a 'wheel bit' ?
-
Ihab Shoully about 5 years'Wheel bit' is a system setting that provides additional special system privileges that empower a user to execute restricted commands that ordinary user accounts cannot access.
-
Ben over 4 yearsTried this on MacOS Catalina - I got an error message on the last command (sorry, I didn't save the message) but the server seems to be up and running for me.