Skip to content

Instantly share code, notes, and snippets.

@mkoistinen
Last active August 29, 2015 14:12
Show Gist options
  • Save mkoistinen/118d2d154a29c300ebb7 to your computer and use it in GitHub Desktop.
Save mkoistinen/118d2d154a29c300ebb7 to your computer and use it in GitHub Desktop.
Automatically start MySQL on system start on Yosemite

The Official MySQL Installer for Yosemite doesn't work.

See/monitor: http://bugs.mysql.com/bug.php?id=74434

It appears they're working on a fix, in the meantime, you can set MySQL to automatically start on system start by:

Instructions:

  1. Put the adjoining file com.oracle.mysql.plist into /System/Library/LaunchDaemons
  2. Adjust [machinename] in line 17 of the plist accordingly.
  3. Set the perms to root:wheel and 0644.
  4. It should now automatically launch when you restart your system, and shutdown when you shutdown the system.
  5. If you'd like to manually stop or start the system: sudo launchctl load com.oracle.mysqld.plist to start or sudo launchctl unload com.oracle.mysqld.plist to stop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>_mysql</string>
<key>GroupName</key>
<string>_mysql</string>
<key>Label</key>
<string>com.oracle.mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<string>--datadir=/usr/local/mysql/data</string>
<string>--pid-file=/usr/local/mysql/data/[machinename].local.pid</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/mysql</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment