0

A very strange error that i can't work out. I can't create a table as mysql says it exists, even though I have explicitly tried to drop it.

mysql> drop table `wp881-2`.`trd_plans`;
ERROR 1051 (42S02): Unknown table 'wp881-2.trd_plans'
mysql> CREATE TABLE `wp881-2`.`trd_plans` ( `id` INT NOT NULL ) ENGINE = InnoDB;
ERROR 1813 (HY000): Tablespace '`wp881-2`.`trd_plans`' exists.

To double check i've also run show tables; and the table doesn't exist there either.

Any help much appreciated.

EDIT: This isn't a duplicate as far as I can tell because I tried the suggested solution of deleting orphaned files and while there was an extra .ibd file (which I deleted), when I tried to execute CREATE TABLE again still the same error.

zag2010
  • 439
  • 2
  • 4
  • 10
  • http://stackoverflow.com/questions/3302476/mysql-1050-error-table-already-exists-when-in-fact-it-does-not – amallard Feb 07 '17 at 06:56
  • CREATE TABLE `wp881-2`.`trd_plans` ( `id` INT(11) NOT NULL ) ENGINE = InnoDB; Try this one. – Naveed Ramzan Feb 07 '17 at 07:05
  • maybe you drop the table, But the underline files in the system dodn't delete for some reasons. – Wajih Feb 07 '17 at 07:12
  • Check whether you have any server cache or schema cache is involved. Most of the case there is schema cache on and will reflect after some hours. – uiTeam324 Feb 07 '17 at 07:12
  • Managed to solve the issue. For anyone reading this, the solution for me was a combination of things: 1) delete extra .ibd tables; and then 2) mysqladmin flush-tables. – zag2010 Feb 07 '17 at 07:25

0 Answers0