Steps to recover data when ibdata file gets corrupted or removed
ibdata is really important file in Mysql because it contains following data –
data dictionary – metadata for Innodb related objects.
double write buffer – protection against a crash in the middle of writing a block to disk.
rollback segments and MVCC data – Undo logs which are required if any transaction needs to be rolled back and also useful if any other transaction needs to see the original data (consistent reads).
And if we accidentally dropped the ibdata file, we definitely cannot rebuild it but we can safely recover all the data onto a new Mysql instance.
- First shut down mysql if its already running :
mysqladmin -uroot -p shut
- Let’s try to start it up to see the error we get