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