Yes this is an old db (we are in the process of migrating). Somehow, phpMyAdmin let a user create a table with a ‘ in it.
name: type_save’
But, I cannot seem to drop that table now. I have tried this from the commandline:
mysql> drop table "type_save\'";
ERROR 1064: You have an error in your SQL syntax near '"type_save\'"' at line 1
mysql> drop table "type_save'";
ERROR 1064: You have an error in your SQL syntax near '"type_save'"' at line 1
mysql> drop table `type_save'`;
'>
How do you properly escape this?
Thanks…
It’s MySQL 3.x, so it’s very likely MyISAM (or even ISAM). Since the normal way to drop the table isn’t working (since you say it crashes the server), and if it’s MyISAM/ISAM, just delete the relevant
.MYI,.MYD, and.frmfiles straight from the filesystem, or move them elsewhere if you need to preserve them for some reason. Then do a flush tables. You don’t even need to shut down the server (at least on Unix, on Windows the file may be in use and Windows may not let you delete it. Flush tables may help).Do not do this if its InnoDB, only ISAM or MyISAM.
If its InnoDB, I’m afraid you may have a dump/reload in your future.
And have backups, of course. Always have backups.