I'm attempting to follow several guides to recover a corrupted database, by setting innodb_force_recovery to 3, dumping the database, dropping the database, and then importing it back in.

I'm able to dump the database, and importing it to a different server seems to display all tables and their data correctly.

Though when trying to drop the corrupted database, I'm shown "Lost connection to MySQL server during query". I'm able to perform other queries, such as SELECT COUNT(1) FROM (as per this guide), but drop/truncate any table or the entire database shows the error.

Setting innodb_force_recovery to anything other than 3 (higher or lower) does not allow me access to mysql.

I should mention that the db is ~20gb, and some tables are large (up to ~200m rows). When trying to run the SELECT COUNT(1) FROM as mentioned before, on the largest tables, after some time I'm getting the same "Lost connection to MySQL server during query" error. Also potentially of note, one of the large tables shows that error immediately, while the others take 20-30s to show the error.

Any advice is appreciated, thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.