- save output of SHOW TABLE STATUS LIKE 't1' and SHOW CREATE TABLE `t1`.
- shutdown mysql server asap!
- backup t1.frm, t1.MYI, t1.MYD immediately
- create a new table t1_recover, which has no auto-inc and no unique/pk.
- remove the files t1_recover.MYD and t1_recover.MYI
- write a C program that scans through t1.MYD reading blocks of length Avg_row_length and checking if first byte indicates a row is marked as deleted.
- if it's deleted, dump it as is into the file t1_recover.MYD
- goto mysql prompt. issue REPAIR TABLE `t1_recover` USE_FRM
You cannot [Read more...]