Mysql – Deleting a Large Crashed MyISAM Table

myisamMySQL

Our server has a large MyISAM MySQL table that is no longer needed and is currently crashed. If we repair it then it greatly slows down our server consuming sources and it's almost 50GB so the process will take a very long time.

Can we safely delete the .myd and .myi files for the table manually? What would be the proper procedure for this to not affect the other tables. Would MySQL simply need to be restarted after we delete the files or are there more steps to this?

Thank you!

Best Answer

From my experience with MYISAM (I am still trying to find documentation that supports it), it is safe to manually delete all three table files (.MYD, .MYI, .frm) and that's it - the table is dropped.

After doing that on a test table, MySQL could not find it anymore (SELECT * FROM test returned an error saying the table does not exist), and I was able to CREATE TABLE test again, so it seems that nothing remains from the original table.

I would recommend the following:

  1. Delete the three files.
  2. Try dropping table table again (this will probably return an error, hopefully 'table does not exist'.

Good luck.