Skip to content

Craft: Searchindex table crashed

Issue

Warning

Upload failed. The error message was: “SQLSTATE[HY000]: General error: 145 Table './craft/searchindex' is marked as crashed and should be repaired The SQL being executed was: SHOW FULL COLUMNS FROM searchindex

What is happening?

This error occurs when there is a problem with the searchindex table. The craft_searchindex table is the only table that uses MySQL's older MyISAM storage engine, instead of InnoDB, which can crash easily.

Solution;

The quickfix for this issue is to login to phpMyAdmin and execute the following command in the SQL tab:

Tip

REPAIR TABLE craft_searchindex;

A more permanent fix, if you know you're running a MySQL version above 5.6.4, you can change the storage engine for that table from MyISAM to InnoDB, with following query, after taking a backup for that table of course:

Tip

ALTER TABLE craft_searchindex ENGINE = InnoDB;