Created
March 21, 2015 17:30
-
-
Save devluis/b922eaf6b6c9e028c653 to your computer and use it in GitHub Desktop.
Auto-load MySQL on startup on OSX Yosemite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, create a new file: /Library/LaunchDaemons/com.mysql.mysql.plist | |
<?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> | |
Then update permissions and add it to launchctl: | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment