Mac Yosemite 10.10 with launchctl self-booting MySQL

Source: Internet
Author: User

due to the current MySQL official DMG installation package, there are only 10.9 system installation packages. such as:


install MySQL in 10.10, if the DMG installation page selected "Boot Start" will be, installation error , only uncheck, only to install success!

such as:




then, this will cause the system to boot the MySQL can not start, only through the command line or the system settings of the MySQL button to start.

What if you want to start it automatically?

start MySQL with launchctl from Mac

Original: http://squll369.iteye.com/blog/1965185

under the Mac installed MySQL, want to set up the boot from start, originally thought and the General Linux system, is also in RC.D such directory placement startup script. On the Internet to check some information, found that Apple should be completely closed, can only use the Mac system Launchctl to do this thing.

Launchctl In fact is to write a *.plist file, its role and Linux in the role of Crontab is the same. The following code is a com.mysql.plist I wrote:

<! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" >

<plist version= "1.0" >

<dict>

<key>Label</key>

<string>com.mysql</string>

<key>ProgramArguments</key>

<array>

<string>/usr/local/mysql/bin/mysqld_safe</string>

</array>

<key>RunAtLoad</key>

<true/>

<key>KeepAlive</key>

<false/>

</dict>

</plist>

1, enter this directory/library/launchdaemons, put the file in this directory

2. Enter this directory in the terminal/library/launchdaemons

Execution

    1. sudo chown root:wheel com.mysql.plist

Modify this plist file must belong to the root user, wheel group, with Chown modified

3. See if there is a problem with the file format

    1. sudo plutil-lint ~/com.mysql.plist

4, finally call the LAUNCHCTL command, load this plist,

    1. launchctl load-w com.mysql.plist

If you do not want to start the boot, enter it in the current directory

launchctl unload-w com.mysql.plist

Mac Yosemite 10.10 with launchctl self-booting MySQL

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.