Start MySQL automatically when your Mac starts

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.