MySQL Forums
Forum List  »  Data Recovery

InnoDB recovery
Posted by: Rudolf Poels
Date: July 24, 2007 01:53AM



We have a corrupted ibdata1 file, and no logs.
I need to salvage whatever I can from this file. How would I go about it?

I tried:

fresh mysql installation
stopped db
recreated the frm files (first took backup, later redid create table statements)
removed innodb log and data files
replaced innodb data file with the corrupted one
started first with recovery set to 0, failed
started with recovery set to 1, failed
started with recovery set to 2, database started, complaining that the number of pages in the header was not equal to the actual number of pages (which is correct, as about 243M of the file is lost)

InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: for more information.
InnoDB: Error: tablespace size stored in header is 978944 pages, but
InnoDB: the sum of data file sizes is only 948992 pages
070724 0:11:30 InnoDB: Started; log sequence number 671 2302454239

show tables now shows the correct tables, but a select from the table tells me that it's not there

mysql> select count(id) from table_name;
ERROR 1146 (42S02): Table 'database.table_name' doesn't exist

I am at a loss. is there any way to recover at least some of the data from the ibdata file?

Kind regards,


Options: ReplyQuote

Written By
InnoDB recovery
July 24, 2007 01:53AM
August 02, 2007 03:13AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.