Schrödingers MySQL table: exists, yet it does not

后端 未结 11 1859
野趣味
野趣味 2020-11-29 23:47

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

11条回答
  •  抹茶落季
    2020-11-30 00:08

    Going on a wild guess here, but it seems like innodb still has an entry for your tables in a tablespace, probably in ibdata. If you really don't need any of the data, or if you have backups, try the following:

    1. Delete all schemas (excluding mysql)
    2. shut down the database
    3. Make sure that all folders in your data directory have been removed properly (again, excluding mysql)
    4. delete ibdata and log files
    5. restart the database. It should recreate the tablespace and logs from scratch.

提交回复
热议问题