Starting MySQL after upgrading to OS X Leopard 18
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.
Enjoying the content? Be sure to subscribe to my RSS feed.





Use sleepwatcher with a .wakeup script to start it up.
I just tried installing MySQL from macports and it fails due to zlib dependency issues on leopard. How’d you get it working Robby?
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.
which version is installed ?
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.
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.
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.
@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.
I am looking for this for a long time. Thanks very much.
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/mysqlLet’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>Upgrading to Xcode 3.0, then installing mysql with macports worked great for me.
Step By Step ReInstall Mysql and Leopard http://www.developingchris.com/2007/10/26/mysql-and-os-x-105-leopard/
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.
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.
Have you tried sudo mysqld_safe ?
Have you tried sudo mysqld_safe ?
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