Recover unconnected tables from ibdata1
I'm encountering data loss of mysql, below is the steps:
1.I converted Table_A from MyISAM to InnoDB (with innodb_file_per_table OFF), saw the ibdata1 size increased;
2.Turned ON innodb_file_per_table;
3.Converted Table_A to MyISAM back, ibdata1 didn't shrink;
4.Converted Table_A to InnoDB, got Table_A.ibd file;
Now I lost the Table_A.ibd file, and want to find data back from the ibdata1 file.
I turn OFF innodb_file_per_table and tried to create the same Table_A with InnoDB format, it fails, and tell me that TABLE_A already exists, and I can't find the table from the schema.
I've searched whole internet and didn't find anything he开发者_C百科lpful, please help!
Goodle Percona data recovery toolkit. You need to:
- Split ibdata1 into pages (page_parser)
- Fetch records from InnoDB dictionary - tables SYS_TABLES and SYS_INDEXES
- Find index_id of your table from SYS_* tables
- Fetch records from pages with index_id of your table (constraints_parser tool).
UPDATE: Data recovery toolkit moved to GitHub
精彩评论