Oct
26
2007
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.

41 Comments » | Add comments | Categories: Development
 

41 comments so far

  1. Hasani Hunter Said on
    I posted a launchd config here:

    http://www.robbyonrails.com/articles/2007/10/27/starting-mysql-after-upgrading-to-os-x-leopard
  2. Zoltán Tóth Said on
    Thank you for the post. You saved me some time. Keep on rocking!
  3. Jarrod Taylor Said on
    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
  4. Phil Hayes Said on
    Awsome solution for MySQL. I look forward to a fix for ColdFusion.
  5. sydneyfx Said on
    Thanks for the tip. I've only just installed Leopard and found this issue so your post has saved me time. :-)
  6. Jason Herald Said on
    here is how to do cf:

    http://blog.jasonherald.name/past/2007/10/28/cf8_on_leopard/
  7. Lars Said on
    Thanks, man. My WordPress installation thanks you, as do all...approximately...ten people who read it. ;)
  8. Chris Chandler Said on
    trackback http://www.developingchris.com/2007/10/26/mysql-and-os-x-105-leopard/
  9. jason Said on
    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.
  10. Jim Said on
    Lifesaver. Thanks
  11. Greg Said on
    Thanks very much for the tip!
  12. Nathan Youngman Said on
    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 Said on
    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 Said on
    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/
  15. Aaron Said on
    Do these commands need to be run every time in order to start mysql?
  16. bananaranha Said on
    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).
  17. Antonio Said on
    Thanks for this post.

    Hopefully we can see a fix to this soon
  18. flatseas Said on
    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 Said on
    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/
  20. Travis T Said on
    Great tip - thanks! that totally worked! Saved me a ton of time...
  21. Andy Said on
    Cheers Russ. This was driving me nuts!
  22. alxx Said on
    How do you remove mySQL ?

    I updated but no longer need mysql.
  23. Michael Cronin Said on
    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 Said on
    Thanks man. That was killing me. Finally got my local sites back up and running... Back to work.
  25. Bryan Said on
    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 Said on
    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 Said on
    !!! Thank you so, so much. You just ended 2 hours of frustrated tinkering with one simple step! Thankyouthankyouthankyou.
  28. Charlie Jackson Said on
    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 Said on
    @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 Said on
    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 Said on
    Thanks, it worked! This is probably the best solution I've seen so far. (because it's the easiest hehe)
  32. Geoff Said on
    Worked well until I upgraded to 10.5.2 and now everything is broke.
  33. Russ Johnson Said on
    Thats weird, mine still works fine. I upgraded both my MBP and my iMac and both still work as expected.
  34. Geoff Said on
    sudo chmod 777 /var/mysql fixed it
  35. DavidS Said on
    Thanks so much for all the help. You didn't just save me time. You made it possible. :-)
  36. Jeremy Said on
    Awesome, your instructions work. Thanks for posting!
  37. Chris St.Germain Said on
    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
  38. Oyun Said on
    thank you!!
  39. Trade Show Displays Said on
    This seems like the most comprehensive blog on this niche

    Regards
  40. AdrienneWhitney Said on
    Some time before, I needed to buy a good house for my business but I did not earn enough money and couldn't buy anything. Thank goodness my father proposed to take the <a href="http://lowest-rate-loans.com/topics/credit-loans">credit loans</a> from creditors. Hence, I acted that and used to be happy with my credit loan.
  41. business loans Said on
    If you want to buy a house, you would have to get the business loans. Furthermore, my mother all the time uses a short term loan, which occurs to be the most firm.
 

Leave a Reply