Mysql – Restore thesql server from thed thei files – windows

MySQLmysql-error-1146restorewindows

I have a recovery disc image which contains the datafiles for mysql server.

The original server is unavailable – all I have is the datafiles (programdata, program files etc).

I am not able to make a mysqldump file.

On the new server, I've installed the exact copy of mysql server, and copied the files/folders (all the myd myi files) from the disc image to the new server.

After restarting the mysql service, I can see the list of my databases in mysql administrator.

However, when I try to view a table, I get an error:

"1146 The table {dbname}.{tablename} does not exist."

I tried running myisamchk but this says there is n problem (at least no error is displayed)

Can anyone help?

Bob

Best Answer

You will need a copy of the corresponding .frm files, which contain the format information MySQL needs to read the raw row data from .myd/.myi or ibdata files. Without the .frm files, MySQL does not know the tables are even supposed to exist (which is why they're not found, and myisamchk doesn't see any broken tables).

If you don't have these files, you may be in trouble. You should be able to reconstruct the .frm by re-CREATEing the tables from scratch, then stopping the server and dropping the .myd/.myis over the empty versions. But you will need to know the exact datatypes and indexes that were originally used in the schema. (“Very difficult repair”)