Mysql – View dropped, now shows as table “in use”, can’t drop

corruptionmyisamMySQLview

I have a view on a MySQL/MyISAM setup, then the underlying table had a column dropped, and made that view invalid.

I tried dropping the view so I could recreate it, then MySQL said it was a table (not a view) and marked it "in use".

Now I can't drop nor repair that table because it says it is not a table.

I've googled for hours trying find a way to fix this 🙁

I do have root access on the MySQL server running Ubuntu. I stopped MySQL and tried myisamchk, but no luck.

I can see a .frm file for the view in the db data folder.

Do I need to delete that file to make the corrupt item go away,
or do I somehow delete the table from the db schema?

I have a db backup from last night, but would rather fix this 1 issue than restore from backup and lose today's changes.

Best Answer

You should be able to simply rename that file to just about anything that doesn't end in .frm and then SHOW TABLES. It should be gone. If it's still there, FLUSH TABLES, then SHOW TABLES again.