Restoring database table?
Posted by: cheeseus (88.87.2.---)
Date: September 23, 2010 03:28PM

Hello,

After an incident with my computer, one of my drives suffered some damage. Using different software, we managed to salvage the majority of files (some files were empty).

The DB files contained in \bin\mysql\mysql5.0.51b\data\project\ are .FRM, .MYI and .MID files. I seem to have all three types for most of the DB tables that existed in there. For some of the tables, the most important one included, I only have the .FRM files.

I have two questions:

1. Is it possible that some tables only have .FRM files, or does this mean that the other files, the .MYD and the .MYI have not been salvaged?

2. Having only got these .FRM files, is there a way to recover the information contained in the respective DB tables? The .FRM files size is between 9 and 10 KB.

Options: ReplyQuote
Re: Restoring database table?
Posted by: stevenmartin99 (---.251.255.14.threembb.ie)
Date: September 23, 2010 04:23PM

.frm files hold the structure of the table. Not all databases have the other files.

Using the myissam storage engine , they would have these myi and myd files

But if the innodb storage engine was being used to store the db then it would only have the .frm file

The actual data for this storage engine is stored in .ibd files which are usually located Directly inside the data folder

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Restoring database table?
Posted by: yfastud (Moderator)
Date: September 23, 2010 04:26PM

With .Frm only, you might able to restore the structures but not data
First create a database to restore and create the tables with same name of XXX.Frm files (with one field, only to create the .Frm files);
Second, stop mysql service and replace the created .Frm files with saved .Frm files;
Finally, start mysql service and see, the tables are replaced with old columns, but sure, without data.

with all 3 files, just copy or put in there and should restore your db winking smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides



Edited 1 time(s). Last edit at 09/23/2010 04:44PM by yfastud.

Options: ReplyQuote
Re: Restoring database table?
Posted by: cheeseus (88.87.2.---)
Date: September 23, 2010 11:35PM

Yeah, it's all gone then... Too bad I didn't export the DB to include in the backup. Will know better next time.

Options: ReplyQuote
Re: Restoring database table?
Posted by: yfastud (Moderator)
Date: September 24, 2010 12:48AM

when your wamp is perfect working state, you should setup backup and keep syncing very often

To setup Backup, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.