Mysql is automatically started when linux is started.

Source: Internet
Author: User

Mysql is automatically started with linux. method 1: use mysql. server to create the Startup Program, which is actually called mysqld_safecp/usr/local/mysql/share/mysql. server/etc/rc. d/init. d/mysqldchkconfig -- add mysqldchkconfig -- level 2345 mysqld on www.2cto.com II. method 2: Write the Startup Program and call mysqld_safe $ vi mysqldauto #! /Bin/shMYSQLHOME =/usr/local/mysql # modify the installation directory for your mysql if [$ #-ge 1]; then mysqldProc = 'ps-ef | grep-E "mysqld. + safe "| grep-v" grep "| wc-l 'if [$1 =" stop "]; then if [$ mysqldProc-eq 1]; then $ MYSQLHOME/bin/mysqladmin-uroot shutdown fi elif [$1 = "start"]; then if [$ mysqldProc-eq 0]; then $ MYSQLHOME/bin/mysqld_safe -- user = mysql & fi fifi $ chmod + x mysqldauto $ mv mysqldauto/etc/rc. d/init. d/$ ln-s/etc/rc. d/init. d/mysqldauto/etc/rc. d/rc3.d/S99mysqld $ ln-s/etc/rc. d/init. d/mysqldauto/etc/rc. d/rc0.d/K20mysqld www.2cto.com

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.