Before installing MySQL, the installer automatically adds the system service and starts MySQL automatically when you start the system.
But after upgrading Mac OSX to 10.10.1 Yosemite today, I found that MySQL did not start when I started the system.
Try using your Mac's Launchctl to implement this feature.
method is also simple.
1. Edit a MySQL boot file.
Enter inside the terminal:
sudo vi/library/launchdaemons/com.mysql.mysql.plist
2. Enter the contents of the startup file:
<?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>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=root</string> </array> </dict>
The/usr/local/mysql/in the XML above is the directory where my MySQL resides.
3. Load this boot file
Enter in the terminal:
sudo launchctl load-w/library/launchdaemons/com.mysql.mysql.plist
This way you will find that MySQL has successfully started.
I have to say, the new Mac is also pretty good.
Start MySQL automatically when your Mac starts