Overview
The MySQL database may experience an error stating that “MySQL table is marked as crashed and should be repaired.” This error can appear at any time, especially after a forced shutdown of MySQL database or due to the crash of the entire server.
Solution
The SWSEARCHINDEX table in particular can crash because it is in MyISAM whereas other tables are in InnoDB. MyISAM tables are more liable to crash due to their nature.
To resolve this issue the first option would be to migrate the table from MyISAM to InnoDB using these instructions: Converting Table to InnoDB.
If this is not an option the following steps can be used to repair the table:
Create a table repair script:
echo "REPAIR TABLE kayako_fusion.swsearchindex;" > /var/lib/mysql/myisam_repair.sql
Then declare it as the startup file in /etc/my.cnf:
[mysqld]