Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I re-create a MySQL InnoDB table from an .ibd file?

Tags:

Assume that the following MySQL files have been restored from a backup tape:

  • tablename.frm
  • tablename.ibd

Furthermore, assume that the MySQL installation was running with innodb_file_per_table and that the database was cleanly shutdown with mysqladmin shutdown.

Given a fresh install of the same MySQL version that the restored MySQL files were taken from, how do I import the data from tablename.ibd/tablename.frm into this new install?

like image 457
knorv Avatar asked Apr 08 '10 08:04

knorv


1 Answers

Similar thing is answered here. please have a look https://stackoverflow.com/a/10943833/3985205

Yes this is possible. It is not enough you just copy the .frm files to the to the databse folder but you also need to copy the ib_logfiles and ibdata file into your data folder. I have just copy the .frm files and copy those files and just restart the server and my database is restored.

like image 105
Snehasish Sarkar Avatar answered Oct 03 '22 17:10

Snehasish Sarkar