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.


Related Blog Entries

Feel free to Leave a Comment or just read what others have to say

38 Comments (Comment Moderation is enabled. Your comment will not appear until approved.) so far

  1. Phil Hayes 10/28/07 9:42 AM
    Phil Hayes's Gravatar Awsome solution for MySQL. I look forward to a fix for ColdFusion.
  2. Jarrod Taylor 10/28/07 11:57 AM
    Jarrod Taylor's Gravatar 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/2...
  3. sydneyfx 10/28/07 3:56 PM
    sydneyfx's Gravatar Thanks for the tip. I've only just installed Leopard and found this issue so your post has saved me time. :-)
  4. Jason Herald 10/28/07 4:11 PM
  5. Lars 10/28/07 4:23 PM
    Lars's Gravatar Thanks, man. My WordPress installation thanks you, as do all...approximately...ten people who read it. ;)
  6. Chris Chandler 10/28/07 7:07 PM
  7. jason 10/29/07 9:34 AM
    jason's Gravatar 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.
  8. Hasani Hunter 10/29/07 4:46 PM
  9. Zoltán Tóth 10/30/07 4:59 PM
    Zoltán Tóth's Gravatar Thank you for the post. You saved me some time. Keep on rocking!
  10. Jim 10/30/07 8:24 PM
    Jim's Gravatar Lifesaver. Thanks
  11. Greg 10/31/07 9:10 PM
    Greg's Gravatar Thanks very much for the tip!
  12. Nathan Youngman 11/1/07 1:28 AM
    Nathan Youngman's Gravatar 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.
  13. Darryl 11/1/07 1:31 PM
    Darryl's Gravatar Thanks for the tip on MySQL.

    It's slightly annoying. Any ideas as to why the Preference thingy can't start it?
  14. Joannou Ng 11/1/07 6:12 PM
    Joannou Ng's Gravatar Migrating MySQL 5.0.45 to Mac OS X 10.5 Leopard
    http://blog.tomatocheese.com/archives/2007/11/1/mi...
  15. Aaron 11/3/07 5:25 PM
    Aaron's Gravatar Do these commands need to be run every time in order to start mysql?
  16. bananaranha 11/8/07 3:32 PM
    bananaranha's Gravatar Well, here's <a href="http://www.bananaranha.com/2007/11/07/how-i-got-my... I did to get PHP and MySQL working</a> on a clean install of Leopad (using some Angry-Fly widsom).
  17. Antonio 11/9/07 2:26 PM
    Antonio's Gravatar Thanks for this post.

    Hopefully we can see a fix to this soon
  18. flatseas 11/10/07 2:55 AM
    flatseas's Gravatar 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
  19. Sean 11/10/07 12:59 PM
    Sean's Gravatar 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/...
  20. Travis T 11/10/07 5:31 PM
    Travis T's Gravatar Great tip - thanks! that totally worked! Saved me a ton of time...
  21. Andy 11/15/07 5:10 AM
    Andy's Gravatar Cheers Russ. This was driving me nuts!
  22. alxx 11/19/07 11:38 PM
    alxx's Gravatar How do you remove mySQL ?

    I updated but no longer need mysql.
  23. Michael Cronin 11/30/07 8:30 AM
    Michael Cronin's Gravatar 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 ;)
  24. Eric 11/30/07 8:03 PM
    Eric's Gravatar Thanks man. That was killing me. Finally got my local sites back up and running... Back to work.
  25. Bryan 12/17/07 4:45 PM
    Bryan's Gravatar 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!
  26. Steven 1/13/08 7:38 PM
    Steven's Gravatar 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.
  27. Heather 1/20/08 11:18 AM
    Heather's Gravatar !!! Thank you so, so much. You just ended 2 hours of frustrated tinkering with one simple step! Thankyouthankyouthankyou.
  28. Charlie Jackson 1/30/08 2:19 PM
    Charlie Jackson's Gravatar 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
  29. Russ Johnson 1/30/08 2:43 PM
    Russ Johnson's Gravatar @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!
  30. Matt Moran 2/7/08 8:00 AM
    Matt Moran's Gravatar 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.
  31. Edmundo 2/12/08 4:11 PM
    Edmundo's Gravatar Thanks, it worked! This is probably the best solution I've seen so far. (because it's the easiest hehe)
  32. Geoff 2/12/08 9:35 PM
    Geoff's Gravatar Worked well until I upgraded to 10.5.2 and now everything is broke.
  33. Russ Johnson 2/13/08 10:12 AM
    Russ Johnson's Gravatar Thats weird, mine still works fine. I upgraded both my MBP and my iMac and both still work as expected.
  34. Geoff 2/13/08 5:45 PM
    Geoff's Gravatar sudo chmod 777 /var/mysql fixed it
  35. DavidS 3/23/08 3:04 PM
    DavidS's Gravatar Thanks so much for all the help. You didn't just save me time. You made it possible. :-)
  36. Jeremy 3/31/08 8:55 PM
    Jeremy's Gravatar Awesome, your instructions work. Thanks for posting!
  37. Chris St.Germain 4/25/08 10:29 PM
    Chris St.Germain's Gravatar 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/M...

    and it is found on this page:
    http://bugs.mysql.com/bug.php?id=28854
  38. Oyun 7/22/08 2:26 AM
    Oyun's Gravatar thank you!!