MySQL Forums
Forum List  »  Install & Repo

Recover database from *.frm files?
Posted by: John Brooking
Date: October 27, 2004 11:52AM

I did probably a very stoopid thing. For the last 2 years, I've had the same version of mySQL installed on my Windows XP machine here at work. I recently got a new machine, and prepared by simplying copying all the data files from the /mySQL/data subdirectory that I used on the old machine. (I know now I should have used mysqldump, but I didn't, so that doesn't help me at the moment.)

Now I've got the new machine, and am attempting to get the database back online. I've got version 4.0.21 of the Windows binary, and everything seems to be working fine in general. But I find that I only got *.FRM files from my old machine, and from what I can see, this version also expects to see *.MYD and *.MYI files. I don't recall seeing those on my old machine, maybe older versions didn't use them? Unfortunately, I don't remember what version I had before. (Regret #2: Not writing that down.) I'm about 99% sure that the desktop support people here have probably reformatted my old hard drive and passed the machine on to someone else by now, although I have a call in to them, to make sure. Obviously, if I can get it back, this plea is moot.

Anyway, moving on, I went ahead and created the database using the CREATE DATABASE command, then copied all the *.FRM files into that directory and stopped and restarted the server. When I get back in, I can switch to using that database, but when I tried a SELECT command against one of the tables, I got "ERROR 1017: Can't find file: 'people.MYI' (errno: 2)". Thus my conclusion that those files are necessary.

So: Is there some kind of utility I can run to reconstruct my database for version 4.0.21, using only the *.FRM files from a prior version? Or am I screwed? Thanks in advance for all advice.

Options: ReplyQuote

Written By
Recover database from *.frm files?
October 27, 2004 11:52AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.