PDA

View Full Version : Restore MySQL from raw data


jared
21 Aug 2009, 3:43pm
Alright, I have a question for any of you server admins - particularly who deal with IIS (i know, I know)

A buddy of mine and I co-manage a Windows server (Actually, he does most of it, I just make websites that go on it :D).

The HD decided to take a dive on us the other day, forcing us to swap out drives, get the install back up to par, and load the backups.

Luckily, we had back ups of all the clients' files. Well, almost.

Some how none of the MySQL data had been dumped during the scheduled backups.

So, after repeated *facepalm*'s we realize we don't have a
good backup of the databases but we do have the complete mySQL 5 directory including the data files. However, I can't seem to find any information about restoring the databases using the raw files.

Any pointers?

cheers :jared:

jared
21 Aug 2009, 4:00pm
Well a buddy of mine said it shouldn't be a problem.

Something along the lines of "fire up mysql, create a DB" and "copy the .myi and .myd files over there".

I'll see what kinda trouble I can get into.

Lincoln
21 Aug 2009, 5:37pm
I like his style. That's what I'd do - create a blank one and overwrite. Good luck.

ardichoke
21 Aug 2009, 9:41pm
Should work. You'll probably want to run a repair on the databases once you're done though just to be safe.

Shorty
24 Aug 2009, 2:32pm
Do that on a demo server with an installation as close as possible to the previous one. Then do a mysqldump into files after doing a table check to correct any tables errors.

Then load it into the new DB fresh. This allows you to correct errors, move to the latest stable version and control data integrity :)