I have copied the /var/lib/mysql/mydbname db to a new machine from a crashed server (booted using a live cd) but now I cannot access the tables within the db...

All the tables only have a .frm extension, so I am assuming they are InnoDB.

They appear in a SHOW TABLES statement, but I cannot SELECT from them.


| Table         | Op    | Msg_type | Msg_text                            |
| mydbname.xyz  | check | Error    | Table 'mydbname.xyz' doesn't exist  |
| mydbname.xyz  | check | error    | Corrupt                             |

myisamchk wont touch them (obviously)...

I am feeling slightly optionless atm.

Thanks in advance.


If they're InnoDB, then you needed to copy the ibdata* and ib_logfile* files across from the crashed server, but you'll pick up other databases' table data then, and it'll all just be too painful. Restore from backup, instead.

  • Great, that will work a treat as all the other databases will eventually be migrated anyway. Thanks, will report how it goes. :) – Christian Jun 15 '09 at 4:13
  • Consider using file_per_table to avoid the problem of maintaining a monolithic ibdata file which contains all your tables. – Dave Cheney Jun 15 '09 at 6:56
  • Only problem with the file_per_table option is that innodb does not return diskspace back to the OS. If you add a lot of data to a table and then remove it again, that diskspace can't be used by another table. – David Pashley Jun 15 '09 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.