(resolved) MYSQL Recovery

Hello All!

I need some help with database recovery.

I was hosting a personal blog for a friend of mine and the server it was hosted on crashed hard. Luckily I was able to recover most of the data, but I cant seem to recover her sites database.

I have all the raw MYSQL files, including the IBD and FRM files, and I have tried several recovery options. I tried doing a fresh install of MYSQL server and importing the raw files, but I don't seem savvy enough to get it to work.

I was wondering if anyone had some pointers. Or if another happy forum member had experience doing this kind of thing i'm willing to pay for their time.

Its not any super mission-critical data, I simply risk the disappointment of my dear friend and the shame of telling her i cant fix it.

Thanks a ton guys!

~Judah

-- EDIT --
With the help of an amazing community member who has asked to remain anonymous, the problem has been resolved. Thanks to this amazing community!

Curious, what ended up being the resolution to this?

So because the database used InnoDB, simply copying over the .idb and .frm files was not enough. There were a few files prefixed with "ib" that also needed copied over.

Once they were copied over half the tables needed repaired. I ran this script to see which ones needed attention:
db = mysql -usomeuser -psomepassword somedatabase
echo "show tables" | $db | while read a; do echo "check table $a" | $db; done | grep -v OK
Once I knew what ones had issues I ran "repair table {table}". Some of the tables were fixed by this, the rest were fixed by the next step.

I then rebooted the service (don't ask why, it just wouldn't work unless i did that) and ran this on the database:
mysqlcheck {database}

Once that was done I was able to use mysqldump to export the data to a file that i could use elsewhere.

In all it was not a difficult process, I simply didn't know how to do it.

2 Likes