Configure MySQL synchronization with system startup and shutdown in Linux

Source: Internet
Author: User

1. Start MySQL synchronization:
Add the following two lines to the/etc/rc. d/rc. local file:
Echo "Starting MySQL Server"
/Etc/rc. d/init. d/mysql. server start

2. Disable MySQL synchronization:
Insert the following two lines at the beginning of the file/etc/rc. d/rc. halt:
Echo "Stopping MySQL Server"
/Etc/rc. d/init. d/mysql. server stop

Note:
1. the file/etc/rc. d/init. d/mysql. server is copied from the mysql installation subdirectory support-files;

2. Because mysql. server considers that mysql is installed in the/usr/local/mysql directory by default, if your mysql is not installed in this directory, create a link that complies with the requirements. For example:

Ln-s/var/log/bak/mysql-5.0.51a-linux-i686-glibc23 // usr/local/mysql

3. the service configured in this way is synchronized with the system startup and shutdown. It is suitable for applications such as IPCop and their streamlined systems, and is not suitable for general releases, because the general release version is in/etc/rc. d/rc3.d/,/etc/rc. d/rc0.d/and/etc/rc. d/rc6.d.

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.