سؤال

What I have learned from Google searching:

With MyISAM tables you can simply copy the FRM, MYD, and MYI files. In the folder for the DB I'm trying to recover, there are only FRM files and a "db.opt" file, so they must not be MyISAM tables.

Situation:

My computer crashed, but the data is still on the hard drive. The MySQL 5.5.8 server was installed with WAMP on the crashed computer.

I have tried copying the entire data folder over, but MySQL only creates a blank database - no tables.

There is an FRM file for each of the tables I wish to recover. However, they are not readable text files. Is there any way to recover the table structure from these files?

This post https://stackoverflow.com/a/7688688/1188138 indicates that the structure is in fact in those files, but does not provide a method of retrieval.

Thank you so much - I have tried everything I can think of.

هل كانت مفيدة؟

المحلول

If you only see the .frm files, then there is a strong likelihood that the storage engine in use was InnoDB and innodb_file_per_table must have been off by default.

If you transferred everything from datadir on the crashed server onto another disk on another machine, you may be able to startup mysql with that folder as is.

For example, suppose ServerA is your crashed server and ServerB is where you want it placed.

  • Install MySQL 5.5.8 on ServerB
  • net stop mysql on ServerB to make sure mysql is down on ServerB
  • md C:\MySQLData on ServerB
  • Drop everything from the data folder on ServerA into C:\MySQLData on ServerB
  • Make C:\MySQLData the new datadir

Add this to my.ini on ServerB

[mysql]
datadir=C:/MySQLData
  • C:\> del C:\MySQLData\ib_logfile* on ServerB
  • net start mysql on ServerB

Please try this and tell us what happened

UPDATE 2012-02-03 17:06 EDT

Since you were able to recover everything NOW DO THIS:

mysqldump -u... -p... -A -d --routines --triggers > C:\MySQLSchema.sql

This will give all table structures in the MySQL Instance.

نصائح أخرى

If you copied the files to the new location, it is likely you copied the files with your user's permissions.

MySQL will need permission to read/write to the data directory.

At TwinDB we built a web interface to mysqlfrm. It's free and easy to use.

To recover table structure from you just need to upload the .frm file.

Here are steps. 1. Open https://recovery.twindb.com/ . Click on "Recover Structure" enter image description here

  1. In next submenu click on "from .frm file" enter image description here

  2. On the next view click on "Browse" and select an .frm file on a local disk. Click on "Upload" enter image description here

  3. Wait till it's doing the magic enter image description here

  4. Get the recovered structure. enter image description here

It's also possible to upload an archive with a bunch of .frm files. The site will recover them altogether.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى dba.stackexchange
scroll top