We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13730
    • 149 Posts
    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

    • 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
        • 13730
        • 149 Posts
        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
        • 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.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
          • Quote from: sottwell at Nov 29, 2012, 08:26 AM
            MySQL 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)
              Patrick | Server Wrangler
              About Me: Website | TweetsMODX Hosting
            • 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).
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org