Read my latest article: Was away on vacation (posted Sun, 11 May 2008 22:33:00 GMT)

Starting MySQL after upgrading to OS X Leopard 18

Posted by Robby Russell Sat, 27 Oct 2007 11:13:00 GMT

If you upgraded to OS X Leopard and are running MySQL from the MySQL.com installer1, you might be having some problems with starting it from the GUI interface. There isn’t a fix from MySQL yet, so to get around that… you can run it from the command-line.

Start MySQL from the command line

cd /usr/local/mysql; ./bin/mysqld_safe &

This should get MySQL up and running for you. If someone wants to share a tip on how to get this to start automatically on reboot, please post a comment and I’ll help get the word out.

1 I didn’t have this problem as I installed MySQL via MacPorts... but this came up for a few members of PLANET ARGON after they upgraded to Leopard.

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
Comments

Leave a response

  1. Avatar
    Greg Newman Sat, 27 Oct 2007 12:35:34 GMT

    Use sleepwatcher with a .wakeup script to start it up.

  2. Avatar
    Greg Newman Sat, 27 Oct 2007 12:37:34 GMT

    I just tried installing MySQL from macports and it fails due to zlib dependency issues on leopard. How’d you get it working Robby?

  3. Avatar
    David smalley Sat, 27 Oct 2007 16:40:19 GMT

    Probably not the safest thing to do, but I saw someone on the official mysql bug report for this suggest doing…

    sudo chmod -R 777 /usr/bin/mysql

    It did that and it all works, even starting from the os x preference pane.

    Hopefully not too difficult for mysql to track down what is causing that if its just a permissions issue.

  4. Avatar
    jerome Sat, 27 Oct 2007 20:09:12 GMT

    which version is installed ?

  5. Avatar
    onizuka Sat, 27 Oct 2007 23:56:45 GMT

    Another easy way is make an Automator application and have it loaded at startup. Just run Automator, all ‘Run shell script’ from Utilities to the workflow, paste ‘sudo /usr/local/mysql/bin/safe_mysqld’ in the text field, save the workflow as an application, and then add this application to you account startup items. Arguably convenient solution, I admit.

  6. Avatar
    andyengle Sun, 28 Oct 2007 04:36:35 GMT

    Hi Rob.

    I checked one of the MySQL error logs on my Mac (running 10.5 Leopard) and found the following:

    /usr/local/mysql/bin/mysqld: Can’t read dir of ’/var/folders/M3/M3v1D9jnFHK0OBHWImeudU+++TI/Tmp/ ’ (Errcode: 13)

    That error was in the /usr/local/mysql/data/Macintosh.local.err file.

    So, I went to /var/folders/M3/M3v1D9jnFHK0OBHWImeudU+++TI/, did chmod 777 on both M3 and the M3v1D… directories, then MySQL started. Those directories appear to be temporary directories (I’ve not seen them before Leopard), but changing the mode on those appeared to fix the problem.

    One other note: my MySQL log file (which was originally called blacktoe.log) is now called Macintosh.log. Blacktoe is the name of my machine, but evidently now MySQL is being made to write the log to that Macintosh.log file, which is also in that /usr/local/mysql/data directory.

  7. Avatar
    David Sun, 28 Oct 2007 05:08:21 GMT

    I enabled the default PHP included with Leopard (5.1.4 I think), and it’s configured to find the MySQL socket in the /tmp folder, rather than /var/mysql/ as is configured with MySQL from mysql.com. This was giving me “unable to connect to database” errors with my web pages, and I solved it by creating a symbolic link named “mysql” in the /var directory that links to /tmp. Problem (temporarily) solved. I figured I’d toss that out in case anybody else is having the same problem.

  8. Avatar
    Josh Kieschnick Mon, 29 Oct 2007 19:44:40 GMT

    @Greg Newman

    I was having the same problems with the zlib dependency, but that was fixed once I installed Xcode 3 from the Leopard CD.

  9. Avatar
    Anna Mon, 29 Oct 2007 20:54:46 GMT

    I am looking for this for a long time. Thanks very much.

  10. Avatar
    Hasani Hunter Mon, 29 Oct 2007 21:33:13 GMT

    I use the following plist for launchd: “com.mysql.mysqld.plist” located in ”/Library/LaunchDaemons”

    To start: sudo launchctl load com.mysql.mysqld.plist To stop: sudo launchctl unload com.mysql.mysqld.plist

    Oh and make sure that the mysql installation is owned by _mysql and _mysql group.

    <?xml version=”1.0” encoding=”UTF-8”?> <!DOCTYPE plist PUBLIC ”-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> GroupName _mysql Label com.mysql.mysqld OnDemand Program /usr/local/mysql/bin/safe_mysqld RunAtLoad UserName _mysql WorkingDirectory /usr/local/mysql
  11. Avatar
    Hasani Hunter Mon, 29 Oct 2007 21:38:11 GMT

    Let’s try this again..

    I use the following plist for launchd: “com.mysql.mysqld.plist” located in ”/Library/LaunchDaemons”

    To start: sudo launchctl load com.mysql.mysqld.plist To stop: sudo launchctl unload com.mysql.mysqld.plist

    Oh and make sure that the mysql installation is owned by _mysql and _mysql group.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>GroupName</key>
            <string>_mysql</string>
            <key>Label</key>
            <string>com.mysql.mysqld</string>
            <key>OnDemand</key>
            <false/>
            <key>Program</key>
            <string>/usr/local/mysql/bin/safe_mysqld</string>
            <key>RunAtLoad</key>
            <true/>
            <key>UserName</key>
            <string>_mysql</string>
            <key>WorkingDirectory</key>
            <string>/usr/local/mysql</string>
    </dict>
    </plist>
    
  12. Avatar
    Jimmy Wed, 31 Oct 2007 18:42:49 GMT

    Upgrading to Xcode 3.0, then installing mysql with macports worked great for me.

  13. Avatar
    Chris Chandler Tue, 06 Nov 2007 14:33:12 GMT
  14. Avatar
    Ash Tue, 11 Mar 2008 23:39:21 GMT

    Hi, I can’t start mysql v. 4 or 5. Using Leopard on a power pc. I get the following error

    :MySQL local$ /Library/MySQL/bin/mysqld_safe & [1] 480 :MySQL local$ touch: /Library/MySQL/var/localhost.local.err: Permission denied chown: /Library/MySQL/var/localhost.local.err: No such file or directory Starting mysqld daemon with databases from /Library/MySQL/var /Library/MySQL/bin/mysqld_safe: line 302: /Library/MySQL/var/localhost.local.err: Permission denied /Library/MySQL/bin/mysqld_safe: line 308: /Library/MySQL/var/localhost.local.err: Permission denied STOPPING server from pid file /Library/MySQL/var/localhost.local.pid tee: /Library/MySQL/var/localhost.local.err: Permission denied 080311 16:34:08 mysqld ended

    What did I do wrong? I have been trying to find a solution for 2 weeks but nothing. Others have this same issue but I haven’t seen a solution yet. Thanks.

  15. Avatar
    Ash Tue, 11 Mar 2008 23:39:27 GMT

    Hi, I can’t start mysql v. 4 or 5. Using Leopard on a power pc. I get the following error

    :MySQL local$ /Library/MySQL/bin/mysqld_safe & [1] 480 :MySQL local$ touch: /Library/MySQL/var/localhost.local.err: Permission denied chown: /Library/MySQL/var/localhost.local.err: No such file or directory Starting mysqld daemon with databases from /Library/MySQL/var /Library/MySQL/bin/mysqld_safe: line 302: /Library/MySQL/var/localhost.local.err: Permission denied /Library/MySQL/bin/mysqld_safe: line 308: /Library/MySQL/var/localhost.local.err: Permission denied STOPPING server from pid file /Library/MySQL/var/localhost.local.pid tee: /Library/MySQL/var/localhost.local.err: Permission denied 080311 16:34:08 mysqld ended

    What did I do wrong? I have been trying to find a solution for 2 weeks but nothing. Others have this same issue but I haven’t seen a solution yet. Thanks.

  16. Avatar
    Philippe Tue, 11 Mar 2008 23:54:43 GMT

    Have you tried sudo mysqld_safe ?

  17. Avatar
    Philippe Tue, 11 Mar 2008 23:55:02 GMT

    Have you tried sudo mysqld_safe ?

  18. Avatar
    dana.moore@bbn.com Thu, 01 May 2008 17:20:41 GMT

    thanks for the tip; the command line approach works fine. Some day I will have to upgrade to an X86 based Mac. Just hate to toss out a perfectly good development envt

Share your thoughts... (really...I want to hear them)

Comments