Skip to content

Instantly share code, notes, and snippets.

@luqmansungkar
luqmansungkar / restore-ibd-frm.md
Created April 12, 2020 05:58
How to restore mysql database from .ibd and .frm file

Have you ever stuck in a condition where you have to restore your mysql database from only an *.frm and *.ibd files? I have.

So what happen is somehow our mysql service is going down and can not be restarted. I try many things to no avail and getting tired of it.

And then I came across this page https://dev.mysql.com/doc/mysql-enterprise-backup/3.11/en/partial.restoring.single.html. I think probably I can just copy the *.frm and *.ibd file, wipe the current mysql data, reset the mysql, and restore those two files. Easy.

So I stupidly remove /var/lib/mysql/[schema_name], and also /var/lib/mysql/ib* file. Restart the mysql, and it start normally. Finally!