Troubleshooting

Fixing a corrupted index on a table

Symptoms

  • Server won't start, or it will start and show a scary FATAL error message.

Repair

  • Continue to increment the innodb_force_recovery option in the database until you can log in: https://ittutorial.org/best-ways-to-repair-corrupt-innodb-table-in-mysql/
  • Dump the table in question to a .sql file.
  • Try dropping the table.
    • You may have to toggle foreign key checking off: https://stackoverflow.com/a/17828127
    • If dropping the table hangs, increase the innodb_force_recovery setting some more until you can.
  • Reimport the table from the .sql file
  • Ensure foreign key checking is re-enabled
  • Remove the innodb_force_recovery option from the config