This article describes how to directly back up data files in MySQL and how to execute SQL statements in actual operations, the following is a detailed description of the main content of the article. I hope you will gain some benefits after browsing it.
Compared with the previous methods, backing up data files is the most direct, fast, and convenient. The disadvantage is that Incremental backup is basically not supported. To ensure data consistency, run the following SQL statement before the back-to-back file:
- Flush tables with read lock;
That is, the data in the memory is refreshed to the disk, and the data table is locked to ensure that no new data is written during the copy process. In this way, the backup data recovery is also very simple, just copy it back to the original database directory.
Note: For an Innodb table, you also need to back up its log file, that is, the ib_logfile * file. Because when the Innodb table is corrupted, these log files can be recovered.
For systems with medium business volume, the backup policy can be set as follows: the first full backup, the daily Incremental backup, and the weekly full backup are repeated. For important and BUSY systems, full backup may be required once a day, Incremental backup once an hour, or even more frequently. To achieve online backup and Incremental Backup without affecting online services, the best way is to use the master-slave replication mechanism (replication) to back up data on the slave machine.
The above content is the description of the MySQL direct backup data file, hoping to help you in this regard.
Original article title: Direct backup of data files
Connection: http://www.cnblogs.com/kfarvid/archive/2009/11/12/1601587.html