Today I was “pleased” with MODx. Edited the text of the page in the admin panel, clicked “save”… and I get the error message:

Execution of a query to the database failed — Incorrect key file for table './bados_db/modx_site_content.MYI'; try to repair it

From this message it is clear that for some reason the modx_site_content table has broken. But why?.. The reasons may be different. But it doesn’t matter, it’s easy to fix a damaged table using phpMyAdmin.

Open PMA, open your database and select the broken table in it. Then in the Operations tab, find the Table Maintenance block and click Restore Table. That’s it, the table should be restored.

You can also restore the table using the console. Run the command in the console:

mysql -h DBhostname -u username -p password database_name

DBhostname - your hostname, username - your login, password - your password and database_name - the DB name.

If all passed parameters were correct, you will be prompted to enter SQL queries:


Run a request:

REPAIR TABLE `modx_site_content`


And just in case, do not forget to make backups of the DB 😊