Entries tagged as Yosemite

Fixing MySQL autostart failure on Yosemite

There's been some DB errors on the website today because there had been reboots and MySQL failed to automatically start each time ever since upgrading to OS X 10.10 Yosemite. I knew of this problem, but since the disruption was starting to get annoying I decided to find a way to fix it. Apparently, the fix goes all the way to 2010 for fixing the same issue in OS X 10.6 Snow Leopard by Marko Tomic. Then a simpler version for Yosemite came up a few weeks ago, which is largely similar to a 2013 entry at Apple Support Communities.

This was happening because MySQL has been using a very old way to autostart the service and never bothered to update it, making it susceptible to failure for several years already. Until there's an official fix, the following should be entered into the Terminal.app, which is essentially creating a plist file for the LaunchDaemon to use on boot.

sudo nano /Library/LaunchDaemons/com.mysql.mysql.plist

Upon entering the "nano" editor, type (or paste) the following lines.

<!--?xml version="1.0" encoding="UTF-8"?-->
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true />
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/mysql/bin/mysqld_safe</string>
      <string>--user=mysql</string>
    </array>        
  </dict>
</plist>

Press Ctrl-O, Enter, then Ctrl-X to save and quit. Then you need to set the file's owner & permissions and load into the LaunchDaemon.

sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist
sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

Finally, restart the Mac and MySQL should autostart. Remember to restart immediately.
Defined tags for this entry: , ,

Server updated to Yosemite

Seeing that there weren't much show-stopping problems with OS X Yosemite 10.10.0, I decided to proceed with updating my Mac mini server's OS from OS X Mavericks 10.9.5. Experiences with the Mountain Lion - Mavericks update helped in getting the web server back up running again relatively quickly. The downtime was only about 2 hours. Not much of a drama to write about.

One problem I noticed is that MySQL does not automatically start on reboot, and it seems to be a known problem. I'll have to remember to manually restart it when I have to reboot the server.
Defined tags for this entry: , , , , ,

Copyright (C) 1996-2024 Woo-Duk Chung (Wesley Woo-Duk Hwang-Chung). All rights reserved.