MySQL: Incorrect information in file: *.frm after server crash

One of the shared hosting providers I have sites on experienced a particularly nasty crash last weekend that they attributed to a RAID array failure. They must not have been using a very fault tolerant RAID level because they lost their OS drive and had to reinstall from scratch. After they reinstalled whatever Linux version they run all but one of the sites was working. My Drupal site was experiencing "Unexpected errors" and none of the pages were working.

The first step was to determine what exactly this unexpected error was. The easiest way to do this is by adding the following lines to settings.php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

I was then able to determine the error was a MySQL error: "Incorrect information in file: *.frm" When I looked at the site database with phpMyAdmin several of the tables were showing as corrupt but not all of them. As well, I noticed the table type was all MyIASM instead of the usual InnoDB. After a quick search it turns out that the "Incorrect information in file: *.frm" errors are caused by InnoDB tables in a database that's not running InnoDB. After contacting the hosting provider, InnoDB was enabled and the site was fully restored.

Comments

Reinstalling whatever Linux version they run all but one of the sites was working. - David Slone