Fix for MySQL on Leopard
After upgrading, I found that there are a few incompatibilities with several applications. Thats to be expected I guess. The two biggies for me is CF 8 and MySQL. I havent managed to get CF 8 running yet but I found a fix for MySQL.
It seems that the preference pane will not work to start or stop MySQL yet so you will have to start it manually from the command line and create a link to the socket file.
First, start MySQL in a terminal window with the following command:
sudo /usr/local/mysql/bin/safe_mysqld
Then either close the terminal and open a new one, or just hit Command-N to open a new terminal window. Then type the following:
sudo mkdir /var/mysql/
And lastly, create a symbolic link to point the default socket file:
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
I will keep posting things as I find problems and fixes.
–== UPDATE ==–
Charlie Jackson posted a fix for getting the preference pane to work. I have posted a write up of the fix here.






I’m just now trying this with CF, but Mark Drew seems to have worked out a fix.
http://www.markdrew.co.uk/blog/index.cfm/2007/10/27/Running-ColdFusion-8-on-Leopard
Awsome solution for MySQL. I look forward to a fix for ColdFusion.
Thanks for the tip. I’ve only just installed Leopard and found this issue so your post has saved me time.
here is how to do cf:
http://blog.jasonherald.name/past/2007/10/28/cf8_on_leopard/
Thanks, man. My WordPress installation thanks you, as do all…approximately…ten people who read it.
trackback http://www.developingchris.com/2007/10/26/mysql-and-os-x-105-leopard/
I posted a launchd config here:
http://www.robbyonrails.com/articles/2007/10/27/starting-mysql-after-upgrading-to-os-x-leopard
you may also want to add this line:
MYSQLCOM=-YES-
to your /etc/hostconfig file… allowing the MySQLCOM startup item to properly start mysql when the system is booted.
Thank you for the post. You saved me some time. Keep on rocking!
Lifesaver. Thanks
Thanks very much for the tip!
Alternatively, to get PHP working (specifically phpMyAdmin) I copied /etc/php.ini.default to /etc/php.ini and modified the mysql.default.socket and mysqli.default.socket lines to point to /tmp/mysql.sock.
Thanks for the tip on MySQL.
It’s slightly annoying. Any ideas as to why the Preference thingy can’t start it?
Migrating MySQL 5.0.45 to Mac OS X 10.5 Leopard
http://blog.tomatocheese.com/archives/2007/11/1/migrating_mysql_to_mac_os_x_leopard/
Do these commands need to be run every time in order to start mysql?
Well, here’s <a href="http://www.bananaranha.com/2007/11/07/how-i-got-mysql-and-php-running-on-leopard/">what I did to get PHP and MySQL working</a> on a clean install of Leopad (using some Angry-Fly widsom).
Thanks for this post.
Hopefully we can see a fix to this soon
I am doing a fresh install and I can’t get past the initial instruction above. So frustrating..
071202 15:53:55 mysqld_safe Logging to ‘/usr/local/mysql/data/Power-Mac-G5.local.err’.
/usr/local/mysql/bin/safe_mysqld: line 366: [: -eq: unary operator expected
071202 15:53:55 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
071202 15:53:58 mysqld_safe mysqld from pid file /usr/local/mysql/data/Power-Mac-G5.local.pid ended
As part of the Darwin source, Apple has made a Leopard compatible MySQL available. I assume it is the version they are including with the server version. Sources are available here:
http://www.opensource.apple.com/darwinsource/10.5/MySQL-43/
Great tip – thanks! that totally worked! Saved me a ton of time…
Cheers Russ. This was driving me nuts!
How do you remove mySQL ?
I updated but no longer need mysql.
Wow what a relief, I have been trying all the other fixes I came across on the net and this one did the job quick and easy. A million thanks
Thanks man. That was killing me. Finally got my local sites back up and running… Back to work.
Wow was that ever easy. I searched for a long time and found all sorts of confusing things but this one was simple and worked first try. Thanks a buch!
Wow, usually doing something this simple never ends up working for me. Great fix! I would love to see a bit more of an explanation of what was done. Thanks none the less though.
!!! Thank you so, so much. You just ended 2 hours of frustrated tinkering with one simple step! Thankyouthankyouthankyou.
I also had the same trouble with the MySQL preference pane (pain?). After much poking around, I found that the pref. pane was calling /usr/local/mysql/support-files/mysql.server
Furthermore, it was trying to run it as me (even though I was prompted for a password).
To get it running, I did the following:
- Rename mysql.server to mysql.server.real
- Create a one-line /bin/sh script called mysql.server with the following:
sudo /usr/local/mysql/support-files/mysql.server.real $1
This hack seems to have fixed the problem for me.
– Charlie
@Charlie – MAJOR THANKS! I tried your solution for the pref pane and it worked perfectly! Im going to post an update with your solution, thanks again!
Having implemented Hasani Hunter’s solution to the startup problem, your prefpane fix doesn’t seem to work. Briefly, Hasani advocates chgrping & chowning everything in the MySQL install dir as _mysql, then creating a daemon plist for launchctl to use. You then start & stop MySQL with "sudo launchctl [load|unload] com.mysql.mysqld.plist" & voila, it works. This gets you past the bug where mysql lacks the privs to read/write to/from its own directories, but the prefpane – despite asking you for an admin password – doesn’t seem to do anything.
Thanks, it worked! This is probably the best solution I’ve seen so far. (because it’s the easiest hehe)
Worked well until I upgraded to 10.5.2 and now everything is broke.
Thats weird, mine still works fine. I upgraded both my MBP and my iMac and both still work as expected.
sudo chmod 777 /var/mysql fixed it
Thanks so much for all the help. You didn’t just save me time. You made it possible.
Awesome, your instructions work. Thanks for posting!
It might be worth noting here since it comes up high on Google for this question: a new preference pane has been released from mySQL that actually works now! The file is:
ftp://ftp.mysql.com/pub/mysql/download/gui-tools/MySQL.prefPane-leopardfix.zip
and it is found on this page:
http://bugs.mysql.com/bug.php?id=28854
thank you!!
Cheers Russ. This was driving me nuts!