MySQL database file cracking Solution

Source: Internet
Author: User

The following articles mainly introduce the actual operation solution for restoring MySQL database files through binary logs when they are broken, this article describes how MySQL database files break down. The following describes the main content of 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 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.

Related Article

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.