I am having to restore a mysql database from .myd and .frm files. And Ii have no idea where to begin, I tried just copying them over while preserving file permisssions but to no avail what other steps do i need to take?
I have a feeling its got something to do with the ib_logfile0, ib_logfile1 and ib_data files. But dont know what to do.
You shouldn’t be doing backups by dealing with the raw MySQL files. It’s trivially easy to end up with a corrupted database that way. Consider what happens when you start copying the files to your backup medium – the copy will take a non-zero amount of time, during which the database could potentially write new data in various places, including the parts you’ve already copied. Now you’re copying a modified file, a mix of old data and new data. This modified copy is almost guaranteed to be corrupted.
You should be using mysqldump or mysqlhotcopy instead, which guarantee a consistent backup.
However, on the chance that your database is relatively quiet and you managed to get a good clean backup copy, the files you need to restore depend on the type of tables you’re restoring. InnoDB stores all of its data in the
ib* files, regardless of database/table name. MyISAM uses files in directories named according to the database/table names.
After copying the backup copies into the correct locations, you’ll have to restart MySQL, as it will still be accessing the original copies of the files.