(All this presupposes you failed to do a recent & proper backup/dump of your data, but that's why you are reading this)
MySQL requires its datafiles ,*.MYI,*.frm,*.MYD to have exactly the right permissions and ownership otherwise MySQL refuses to see them.
Now this is a problem for me on Vista (de-Vista-ted) because I still haven't worked how to change ownership.
Solution:
1) In new Database create a table with same name , populate with a record or two (doesnt have to have same structure)
1a) I didnt need to do this as I used a month old backup
2) Use Windows Explorer to copy your "good" frm,MYI,MYD on top of the dummy files you created
3) They will automatically inherit the correct owner/permissions
4) When I did this, I was saddened to see however that I couldn't see my new records (probably due to different MySQL versions)
5) I did a Table diagnostics and saw there was an error (using SQLYOG)
6) Did a Repair Table in same Table Diagnostics and wow there were my lovely records!
7) Implement an automatic nightly backup of your databases
So it is possible to recover your database from the raw files, but watch out for :-
file permissions & file ownership and try to have the same MySQL version.
You could do all this on a spare PC and then do a proper backup/dump which is then portable!
Labels: backup, Recovery, SQLYOG