Today, the local deployment of a new project, the result of accidentally put another library of the table all deleted, then that heart, with some hard disk recovery tools have not recovered, had to think of another way, fortunately recorded the Binlog, finally the data are restored. After really want to see clearly again deleted, fortunately is the local article library, not the library on the server, or really trouble, but also because it is the library on their own computer, never back up, so it is really troublesome to recover. Keep a record here.
First make sure your MySQL has no bin log enabled, just look at the Log-bin=mysql-bin in Mysql.ini (MY.CNF), you can customize a directory and prefix name, such as/data/log/mylog.
Then in the database files stored in the data directory can see mysql-bin.00000x such a file, which is binary log, we can export to TXT format, which is actually the database of various operational SQL statements.
Export TXT file:
E:\wamp\bin\mysql\mysql5.6.12\bin>mysqlbinlog--database=testdatabase E:\wamp\bin\mysql\mysql5.6.12\data\ mysql-bin.000312 > C:\\test1.txt
This is the export under Windows, and Linux is similar.
*--database= database name
* restore
from the oldest log
*linux can be very convenient mysql-bin.000*
* can add parameter start time and end time, which is the time you execute that SQL statement
*--start-datetime=" 2014-12-04 11:25:56 "--stop-datetime=" 2014-12-04 13:23:50 " 
Recover data:
E:\wamp\bin\mysql\mysql5.6.12\bin>mysqlbinlog--database=yundongchao E:\wamp\bin\mysql\mysql5.6.12\data\ mysql-bin.000179 | Mysql-u root-p
------------------------------------------------
My Independent blog: Accommodating Kid- http://www.zyblog.net/
This article link: http://www.zyblog.net/post-178.html
fitness boom: http://www.jianshenchao.com
Welcome reprint, Reproduced Please indicate the source of this article.
No more hands, no more. Recover data with Mysqlbinlog