Proper Way to Remove Mysql Tables

by chris85   Last Updated April 16, 2018 02:06 AM

I was going to ask why mysqldump was trying to write dropped tables but I found that answer from this question, How do you remove reported non existing tables from mysql?.

Removing the .frm files from my datadir has resolved the mysqldump issue of trying to dump non-existent tables. Now my question is how do I drop a table and have all references to it removed? I would have thought issuing the drop table would remove all associated files in the directory. I am using MyISAM so perhaps the issue is related to that.

Answers 1

Just remove all three of the correlated table data files from the file system and that should ensure all traces are removed as per my understanding of 15.2 The MyISAM Storage Engine

Each MyISAM table is stored on disk in three files:

  • .frm
  • .MYD
  • .MYI

Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format. The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension.


Further Resources

Pimp Juice IT
Pimp Juice IT
April 16, 2018 05:19 AM

Related Questions

Fixing MyISAM database without losing data

Updated May 28, 2015 22:02 PM

How to check foreign keys related to a table

Updated May 24, 2015 21:02 PM

Speedup DROP huge MySQL replicated table

Updated May 03, 2017 11:06 AM

Replacing table with another

Updated April 04, 2017 19:06 PM