MySQL Forums
Forum List  »  Data Recovery

Re: Rebuild a broken mysql database using .frm or .ibd data. SQL files are 0byte. Resynchronize mysql Software for Windows to restore .ibd data.
Posted by: Saroj Mahanta
Date: December 11, 2023 11:07PM

I too have the similar problem.

my source database is mysql v5.5
periodical backups are : .ibd and .frm files for each table ( total 70 tables)
my target database is mysql v8.0 ( i created a new mysql database version 5.7 and trying to import the backedup ibd files. Details in the Description below.)


Description:
I am trying to restore/import database from the backups. I have .ibd and .frm files. And also the .sql file with all the table creation script inside it.
Method followed :
A. Installed a new mysql database.
B. Created a database with same name as it was there in the source database.
C. From the .sql file i picked one table creation script, run it in the new mysql database.
D. alter table <tablename> discard tablespace;
E. went to the server and copied the tablename.ibd from the backedup directory to the current mysql data directory , ie /var/lib/mysql/confluence/
F. chown mysql:mysql <tablename>.ibd
G. Went to the mysql prompt and run Alter table <tablename> import tablespace.
H. I get and error, message as below.
ERROR 1808 (HY000): Schema mismatch (Clustered index validation failed. Because the .cfg file is missing, table definition of the IBD file could be different. Or the data file itself is already corrupted.)

i manage to restore some of the ibd files, but some parent tables with more number of columns, unable to restore them.

Kindly advise.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Rebuild a broken mysql database using .frm or .ibd data. SQL files are 0byte. Resynchronize mysql Software for Windows to restore .ibd data.
590
December 11, 2023 11:07PM


Sorry, only registered users may post in this forum.

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.