Modx : 2.2.0
PHP : 5.2.17
MySql : 5.1.65
This morning my client cannot access to the resources tree, all he can see is the web context house, but he can access the others tab.
In the Modx error log I see this message :
[2012-11-28 16:42:19] (ERROR @ /connectors/resource/index.php) Error HY000 executing statement:
Array
(
[0] => HY000
[1] => 145
[2] => Table './my_database/modx_site_content' is marked as crashed and should be repaired
)
I open phpMyAdmin an effectively for the « modx_site_content » table I got this message :
#145 - Table './my_database/modx_site_content' is marked as crashed and should be repaired
The questions :
1) Not being familiar too familiar with MySQL, how do I fix this?
2) What could cause this problem?
Thank you very much for your help
-
MODX Staff
- 1,535 Posts
PHPMyAdmin has an option to repair the table. When viewing the table in PHPMyAdmin, go to the Operations tab and there'll be a link to 'Repair Table'.
Garry Nutting
Senior Developer
MODX, LLC
Email:
[email protected]
Twitter: @garryn
Web: modx.com
Thank you very much for your answer.
I just find another way
1) Login to your cPanel
2) Go to the MySQL section, and click the "REPAIR" icon next to your database's name
Thanks again
-
☆ A M B ☆
- 24,524 Posts
Database tables are just files pretty much like any other file on the server, except they're encrypted. The MySQL engine reads from and writes to these files a LOT, encrypting and decrypting as it does so. So it's not unusual for something to hiccup during a write, especially if it's on shared hosting where as many as 400 separate sites can be installed and using the same MySQL server, causing the encryption part to not work properly. MySQL can usually recover the table with its "repair" functions.
-
☆ A M B ☆
- 2,213 Posts
Quote from: sottwell at Nov 29, 2012, 02:26 AMMySQL can usually recover the table with its "repair" functions.
Don't let this be an excuse for keeping REGULAR backups on the same server or better on a remote server (could be emailed to your gmail for that matter)
-
☆ A M B ☆
- 24,524 Posts
Indeed. As I said, it can usually recover the table. If it's too badly corrupted for the recover functions to work, then you had better have a recent backup!
Of course, MODx Cloud makes a backup for you on a daily basis automatically with a one-click restore from the selected backup in your Vault. So before thinking Cloud's too expensive, consider what that alone is worth to you (and your client).