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