I am having the weirdest error of all.
Sometimes, when creating or altering tables, I get the \'table already exists\' error. However, DROP TABLE returns \'#1051 - u
I've seen this issue when the data file is missing in the data directory but the table definition file exists or vise-versa. If you're using innodb_file_per_table, check the data directory to make sure you have both an .frm
file and .ibd file for the table in question. If it's MYISAM, there should be a .frm
, .MYI
and a .MYD
file.
The problem can usually be resolved by deleting the orphaned file manually.