MySQL database executes the backup method on a daily schedule

Source: Internet
Author: User

This database backup method is a simple database backup method, that is, from the MySQL data file, the database files are copied to the specified folder directory

1. Create TXT file, add script

net stop mysqlxcopy d:\mysql\data\*.* d:\mysqldataback\%date:~0,10%-data\/ynet start MYSQL

Where this script is a table file that copies data

net stop mysql: stop MySQL service;

xcopy d:\mysql\data\*.* d:\mysqldataback\%date:~0,10%-data\/y: Copy the database file, copy the source directory to the specified directory, d:\mysql\data\*.* will change all the files under the disk, Copy to the D:\mysqldataback\%date:~0,10%-data\ folder and have the current date named;

net start MySQL: Restart MySQL service

2. Create TXT file, add script

net stop mysqlxcopy d:\mysql\data\jterp\*.* d:\mysqldataback\%date:~0,10%\/ynet start MYSQL

Where this script is a log file for copying data;

After creation, change the txt suffix to the bat suffix;

3. Add timed tasks; Which server the database is installed on, and on which server to add the Scheduled tasks

Follow the appropriate steps to perform the next step;

Annotations: This database backup is only a daily scheduled backup of the data table structure and data; A stored procedure or function is not able to be backed up.

MySQL database executes the backup method on a daily schedule

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.