(GO) mysql5.7 restore the database Linux based on the mysqlbinlog binary file

Source: Internet
Author: User

Original: http://blog.csdn.net/qq_15058425/article/details/61196085

1. Start Mysqlbinlog log function

First look for the location of the my.cnf file:

2, edit the my.cnf file, add the following, and then press ECS, Wq save exit

3, so the Mysqlbinlog function is opened. Restore the database based on MySQL log

4. View the log files, my log files in the data directory of the database files:

5, through the Mysqlbinlog to view the contents of the log file:

A. Find the Mysqlbinlog directory first

B. View the log file in this directory:

Log file:

Such log files in addition to creating tables and delete the table of SQL, the operation of the database statements are encrypted, to see the specific SQL, with the following command:

Log file:

6. Restore the database according to the point of time:

Currently the records in the in table in my ZZ database have been deleted and the database is now recovered based on location:

View the latest logs, 18

Where to insert the table:

Where the last record commits:

Perform the recovery according to these two places:

View database: Restore success:

Recovery by point in time:

The same effect, complete!

(GO) mysql5.7 restore the database Linux based on the mysqlbinlog binary file

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.