MySQL Error deletion processing method

Source: Internet
Author: User

Check if binary logging is on: Show variables like '%bin% '; if Log-bin show off is not open, do not open the words in/etc/my.cnf in the [mysqld] under Add log-bin= Mysql-bin (where Mysql-bin is the beginning name of the log file and can be customized)

MySQL mistakenly delete data files ,

The first method: This way requires the binary file content is very full, if Binary Files not inside . build a statement, drop that table and you won't be able to recover.

To see which binaries are being used:show master status; see it's mysql-bin.000002.

Backup: Mysqlbinlog mysql-bin.000002 > Test1.sql

Modify sensitive data: For example, drop database xx

Recovery: MySQL < Test1.sql


The second method:

The first step is to see what the name of the binary log file is currently in use: Show Master status;

See how many binary log files are currently in common and their size: show master logs;

Second: Look at the log file command, mainly look at the log file has what SQL statement, find out the time point for the following recovery operation:/usr/local/mysql/bin/mysqlbinlog mysql-bin.000091 | Less

Two ways to recover from binary log files: One is by time:/usr/local/mysql/bin/mysqlbinlog--start-datetime ' 2017-02-14 0:12:59 '--stop-datetime ' 2017-02-14 0:13:31 ' mysql-bin.000091 | Mysql-uroot-proot time to see the accurate

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/8F/6F/wKioL1jeHLewg0CEAAB7UE4nPSQ331.png-wh_500x0-wm_ 3-wmp_4-s_2206202868.png "title=" 13.png "alt=" Wkiol1jehlewg0ceaab7ue4npsq331.png-wh_50 "/>

The start time of the CREATE table C2 in is 2017-02-14 0:12:59 and the Stop Time is: 2017-02-14 0:13:31

The second one at xxx,xxx is size, look size:/usr/local/mysql/bin/mysqlbinlog--start-position=361--stop-position=574 mysql-bin.000091 | Mysql-uroot-proot


This article is from the "Flying Small GUI" blog, make sure to keep this source http://9237101.blog.51cto.com/9227101/1912158

MySQL Error deletion processing method

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.