Mac Yosemite 10.10 with launchctl self-booting MySQL

Source: Internet
Author: User

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

Perform

    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

Original: http://my.oschina.net/huyuaning/blog/334584

Mac Yosemite 10.10 with launchctl self-booting MySQL

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.