We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25323
    • 17 Posts
    For some unknown reason I started getting database errors when viewing my modx site. Upon further investigation, I have found 6 of the tables are corrupt. When I attempt to drop these tables, I get a "table in use error". Repairing them doesn’t work either. These tables are all of type InnoDB as per the standard modx installation:

    log_access
    log_hosts
    log_operating_systems
    log_referers
    log_user_agents
    log_visitors

    Can anyone please tell me:
    1. What possibly caused this problem?
    2. How I can forcibly delete these tables or overwrite them with new, working tables?

    Thanx smiley
      • 18397
      • 3,250 Posts
      I have no idea as to exactly how this problem occurs but you can use phpMyAdmin to delete the tables and then run the relevent parts from setup.sql in the install folder to recreate the tables (make sure to swap out the prefix with your own).
        • 25323
        • 17 Posts
        I’ve been trying this via phpMyAdmin but it won’t allow me to delete these tables:

        Error

        SQL query:

        DROP TABLE `modx_log_access`

        MySQL said: Documentation
        #1051 - Unknown table ’modx_log_access’
          • 25323
          • 17 Posts
          Ok, I tried remedying the problem by dumping the old database (modx) and utilising a new one (modx2). This morning the same tables in modx2 have become corrupted!

          WTF is going on here?! Hope someone here can shed some light on the cause of this. I’ll keep trying but until I find a solution I will have to cease using implementing modx as the CMS for our website. sad
            • 4041
            • 788 Posts
            first try disabling logging in the System Settings, this has been an issue ever since this feature was implemented many moons ago.

            Then install some other visitor logging script if it is really needed.
              xforum
              http://frsbuilders.net (under construction) forum for evolution
              • 25323
              • 17 Posts
              Cheers for the tip, Breezer smiley

              I’ve done a complete reinstall and i’ll see if dissabling logging will rectify this quirk.

              Rob
                • 25323
                • 17 Posts
                Also, does anyone know if this issue has anything to do with the offending tables being of type "InnoDB" where as all the others are "MyISAM"?!
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Well, it may depending on your MySQL server installation and configuration. If you want to you can change that to MyISAM, since the InnoDB features aren’t used.
                    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