drop table Tbl_name Physical deletion. No backup, no binary log
Deleting files in the system does not erase the data in the store, but only identifies the block blocks that can be reused for redistribution.
So the recovery of data is still hopeful. However, the recovered data blocks cannot be overwritten by other data, and the file system itself is normal.
1. Stop MySQL Now
2. View the inode number of the MySQL installation directory. Generally if there is only one MySQL directory on a disk, then the Inode is 2.
ll-id/usr/local/mysql/
3. Umount/path/to/mysql_data
Tool dependencies: (in the installation package CD-ROM)
Yum Install e2fsprogs-devel.x86_64 e2fsprogs-libs.x86_64 e2fsprogs.x86_64-y
tool a Extundelete. Applicable with Ext4 file system
Tar XF extundelete-0.2.4.tar.bz2
CD extundelete-0.2.4
./configure
Make && make install
EXTUNDELETE/DEV/SQLBAK/SQLBCK_LV--inode 2 # #查看mysql安装目录下的所有文件
Extundelete/dev/sqlbak/sqlbck_lv--inode 97537# #选择mysql安装目录下的data目录
Extundelete/dev/sqlbak/sqlbck_lv--inode 97541# #继续查找想应的想要恢复的文件
....
Extundelete/dev/sqlbak/sqlbck_lv--restore-inode 97653 # #恢复想要恢复的文件, will be at the end of the file
There are deleted signs.
MV recovered_files/file.97653 T2. MYD # #rename The original file
Mount MySQL directory, MV recover files, modify master for MySQL, boot file
--------Instance----------
Inode is allocated
File mode:16877
Low + bits of Owner uid:0
Size in bytes:1024
Access time:1450538126
...
File name | Inode number | Deleted status
. 2
.. 2
Bin 32513
COPYING 11
Data 97537
...
Lib 130053
Lost+found 15
Mysql-test 16
Tool two Ext3grep for use with Ext3 file system
Similarly, the dependency package, installation environment is the same
Ext3grep/dev/sqlbak/sqlbck_lv--ls--inode #多一个--ls
EXT3GREP/DEV/SQLBAK/SQLBCK_LV--restore-inode 97653
Recovery of MySQL data mistakenly deleted (drop). (Ext3grep, Extundelete)