The following articles mainly describe the actual operation steps for restoring MySQL database files with binary logs when they break down, if you are not clear about restoring MySQL database files by using binary logs, you can read this article.
I. Scenarios
1. You have used innerdb and enabled binary log
2. You back up your database to another machine every day.
3. the MySQL database file is broken.
4. Your binary log is well preserved
Ii. Objectives
1. Try to restore to the real environment before the file breaks
Iii. Process
1. recover data from the last day of your daily backup
2. query all the tables in the latest data. The last record change time is as follows: 01:23:59
3. Run the following command: MySQLbinlog -- database = "database Name" -- start-datetime = "2010-02-22 01:24:59" MySQL-bin. [0-9] * | MySQL-u root-p
A. database: the database you want to restore. We recommend that you use one database.
B. start-datetime: the time point from which you want to recover the data. This should be pushed back based on the last update time found in 2. Usually, the point can be found only after several attempts.
The above content is an introduction to restoring MySQL database files with binary logs after they are broken. I hope you will gain some benefits.
The above content refers to the description of restoring MySQL database files with binary logs after they are broken. I hope it will help you in this aspect.
Original article title: MySQL database files are restored by binary logs after they are corrupted
Connection: http://www.cnblogs.com/cerxp/archive/2010/02/22/1671151.html