[kwlug-disc] how to recover corrupt mysql database from .frm files?

Robert P. J. Day rpjday at crashcourse.ca
Wed Feb 24 05:44:29 EST 2010

  a colleague asks me if there's a way to recover a mysql database
that was being hosted by someone else and was apparently corrupted in
ways that are not at all obvious.

  all the hosting company is providing him with is a tar file of the
/var/lib/mysql/<db> directory, which consists of nothing but .frm
files (so it's in innodb format, correct?).  they won't give him the
ibdata1 file or ib log files, for security reasons.

  as a trivial test, i simply untarred the db .frm files under *my*
/var/lib/mysql directory and fired up mysql.  "show databases;" sees
the alleged database, i can switch to it, "show tables;" also lists
all the tables, but if i try to describe a table:

mysql> desc <table name>;
ERROR 1146 (42S02): Table '<db name>.<table name>' doesn't exist

  not at all surprising since there is no record of this database on
my system in the ibdata1 file.  that's all he's got, and he'd really
like to recover the data in that database, but his hosting company
won't provide him with any further information or data, and they
apparently don't have backups with which to restore.

  so ... i'm by no means a mysql expert, is there anything that can be
done with nothing but the directory of .frm files?


Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday

More information about the kwlug-disc mailing list