Search code examples
mysqlinnodbcorruption

MySQL (InnoDB): Cannot drop database nor create it


When trying (InnoDB):

DROP DATABASE mydatabase;

I almost inmediately get:

ERROR 2013 (HY000): Lost connection to MySQL server during query

I checked the timeouts and they are far enough from being short (600 seconds) so I stopped MySQL, removed mydatabase folder and started MySQL again. Then I re-created my DB and loaded it from a dump:

mysql -u <user> -p mydatabase < Dump.sql

But the process failed once and again due to some already existing table (though I'm sure it is not duplicated in the dump file), so at this point I don't really know what to do and whether I'm facing some InnoDB corruption issue (logs do not show anything related).

Any thoughts?


Solution

  • So finally, as (credits go for him) @t.niese's link points out, I quit trying to drop the (corrupted) DB and ended up recovering the dump into another DB, just changing its name. Fortunately I didn't need to have the same name, so I skipped the long process pointed out at that link. But alas it seems the corrupted database will stay in the ibdata1 file.