Mac 10.12 Create custom services via LAUNCHD (start-up from MySQL 5.7.15)

Source: Internet
Author: User

In the previous article http://www.cnblogs.com/EasonJim/p/6275863.html installed MySQL when installing the installation Steps page of the DMG package, if such installation of MySQL is going to boot from the boot, And in the system setup there is MySQL on the service of the quick interface.

Then if you are installing based on a binary package, if you want to implement boot-up, then you need to use the LAUNCHD for service management.

Implementation steps:

1, in/library/launchdaemons under the new Com.oracle.oss.mysql.mysqld.plist file, the contents are as follows:

<?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 "><plistversion= "1.0"><Dict>    <Key>Disabled</Key>    <false/>    <Key>Exittimeout</Key>    <integer>600</integer>    <Key>GroupName</Key>    <string>_mysql</string>    <Key>KeepAlive</Key>    <true/>    <Key>Label</Key>    <string>Com.oracle.oss.mysql.mysqld</string>    <Key>Launchonlyonce</Key>    <false/>    <Key>Processtype</Key>    <string>Interactive</string>    <Key>Program</Key>    <string>/usr/local/mysql/bin/mysqld</string>    <Key>Programarguments</Key>    <Array>        <string>/usr/local/mysql/bin/mysqld</string>        <string>--user=_mysql</string>        <string>--basedir=/usr/local/mysql</string>        <string>--datadir=/usr/local/mysql/data</string>        <string>--plugin-dir=/usr/local/mysql/lib/plugin</string>        <string>--log-error=/usr/local/mysql/data/mysqld.local.err</string>        <string>--pid-file=/usr/local/mysql/data/mysqld.local.pid</string>    </Array>    <Key>Runatload</Key>    <true/>    <Key>Sessioncreate</Key>    <true/>    <Key>UserName</Key>    <string>_mysql</string>    <Key>WorkingDirectory</Key>    <string>/usr/local/mysql</string></Dict></plist>

Tip: To create a file you can use the VI command for these, note to add sudo to the beginning.

2, modify the permissions:

sudo chown root: Wheel com.oracle.oss.mysql.mysqld.plist  

3. Check grammar

sudo plutil-lint com.oracle.oss.mysql.mysqld.plist   

4. Loading

Tip: This setting is ready to boot.

5, uninstall, cancel boot from boot

Delete com.oracle.oss.mysql.mysqld.plist

Reference:

http://blog.csdn.net/lolashe/article/details/41117577

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

http://www.cnblogs.com/EasonJim/p/7173859.html (Basic Service command operation)

HTTPS://EN.WIKIPEDIA.ORG/WIKI/LAUNCHD (plist syntax Reference)

Mac 10.12 Create custom services via LAUNCHD (start-up from MySQL 5.7.15)

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.