Set mysql automatic backup in CentOS

Source: Internet
Author: User
Tags mysql automatic backup

Set mysql automatic backup in CentOS
Create backup Folder: mkdirmysql_data_bak script file: touch autobackupmysql. sh www.2cto.com open the file vi autobackupmysql. sh adds the following content to the script: filename = 'date + % Y % m % D'/usr/bin/mysqldump-uroot-proot boss>/home/mysql_data_bak/$ filename. crond is not installed in the SQL check. If no, install yum-y install vixie-cronyum-y install crontabs to start the service: service crond start www.2cto.com and add it to the CentOS System for Automatic start: chkconfig -- level 345 crond oncrontab-e: 00 03 *** source/root/autobackupmysql. sh runs this file at every day and backs up the database with service crond restart.

Create backup Folder: mkdirmysql_data_bak script file: touch autobackupmysql. sh www.2cto.com open the file vi autobackupmysql. sh adds the following content to the script: filename = 'date + % Y % m % D'/usr/bin/mysqldump-uroot-proot boss>/home/mysql_data_bak/$ filename. crond is not installed in the SQL check. If no, install yum-y install vixie-cronyum-y install crontabs to start the service: service crond start www.2cto.com and add it to the CentOS System for Automatic start: chkconfig -- level 345 crond oncrontab-e: 00 03 *** source/root/autobackupmysql. sh run this file at every day, back up the database service crond restart to complete the original link: http://www.2cto.com/database/201301/186017.html

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.