Matthew,

Someone asked this question last year.  It turns out that there's only a
one-character difference between the InnoDB and MyISAM .frm files.

See the posting below from last May for a way to recover the InnoDB table
structure, given an InnoDB .frm file but no data files, basically by
patching the InnoDB .frm file to look like a MyISAM .frm file.  I
understand that it worked pretty well.  Good luck.

Adam,

This probably doesn't do anything for you.  Sorry.

Regards,

Bill

> From: "Heikki Tuuri" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: Re: Recreating InnoDB tables -WITHOUT- .frm
> Date: Tue, 13 Jan 2004 22:02:36 +0200

> Matthew,

> http://www.innodb.com/ibman.php#InnoDB_Monitor

> "
> Starting from 3.23.44, there is innodb_table_monitor with which you can
> print the contents of the internal data dictionary of InnoDB.
> "
> The output format is not beautiful, and you have to manually reconstruct
the
> MySQL CREATE TABLE statements from it.

> Adam,

> you can try creating a dummy InnoDB table with enough PRIMARY KEY columns.
> Then replace its .frm file with an old one you have, and try to print SHOW
> CREATE TABLE. I do not know if mysqld will crash or assert. This question
> was discussed on this mailing list some 2 years ago.

> Best regards,

> Heikki Tuuri
> Innobase Oy
> http://www.innodb.com
> Foreign keys, transactions, and row level locking for MySQL
> InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up
MyISAM
> tables

> Order MySQL technical support from https://order.mysql.com/

> ...........................
> List:MySQL General Discussion« Previous MessageNext Message »
> From:Matthew ScottDate:January 13 2004 5:33pm
> Subject:Recreating InnoDB tables -WITHOUT- .frm



> To all the InnoDB gurus out there:

> I have a similar problem to this person's predicament, except my situation
> is that I have all the innodb data and log files, but have absolutely
> no .FRM files.

> Are there any general tools for data recovery from InnoDB databases?  Any
> companies that can do this for a fee?  Anything???   :)

> Thanks.    <crossing my fingers that myself and Adam can find resolutions
to
> our respective situations!>


> [EMAIL PROTECTED] wrote:

> > I'm cleaning up a user-error where the innodb data files were deleted
> > without a useful backup. I need to reconstruct the tables and still have
> > the frm files. Is this possible? A significant amount of time was put
into
> > these tables' structures and I hate to lose that effort...
> >
> > Yes the users are kicking themselves about the backup...
> >
> > MTIA
> > Adam
> >


> -- 
> Matthew Scott <[EMAIL PROTECTED]>

======== Posting from 2003-05-31 ========

Mark,

Here's a "brute force and ignorance" approach.  Disclaimer:  It has worked
once,
and may work again some day.  In particular, I haven't looked at the MySQL
internals, and I've only tried it on a very small table.

You have "foo.frm", which used to be the .frm file for an InnoDB table.

I note that the (only) difference between .frm files for MyISAM and InnoDB
is that
the fourth byte of the file is hex 09 for MyISAM and hex 0C for InnoDB.
(This,
from comparing .frm files for a very small and simple database.)

0.  Make sure you have foo.frm saved somewhere other than your MySQL data
directory.

1.  Create a new MyISAM table foo; it doesn't matter what the layout is.
For example, "create table foo (n int);"

2.  Copy your foo.frm over the one created in step 1.

3.  Change the fourth byte of foo.frm to hex 09 instead of hex 0C.

4.  From the MySQL client, say "show create table foo;"

Good luck.  HTH.

Bill


>Date: Thu, 29 May 2003 12:47:02 -0700
>Subject: RE: Recovering table structures from .frm files?
>From: Mark Morley <[EMAIL PROTECTED]>
>To: Mark Morley <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>
>> I have a couple of .frm files with no corresponding data or index
>> files.  Is it possible to recover the table structure (field names,
>> types, sizes) from these files?
>
>More info: these appear to have been created under MySQL 4.0.x and they
were
>originally InnoDB files.  I can see a list of field names by running
"strings"
>on each .frm file, but I'd really like to get the colum types and sizes as
well.
>
>Is the file format documented anywhere?
>
>Mark



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to