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