ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Corrupted Database Table

March 11, 2011 5:26pm

Subscribe [3]
  • #1 / Mar 11, 2011 5:26pm

    rockthenroll

    485 posts

    I decided to move my MAMP setup into Dropbox to sync between computers and along the way started getting this error:

    A Database Error Occurred
    Error Number: 1036
    Table ‘exp_online_users’ is read only
    SELECT * FROM (`exp_online_users`) WHERE `site_id` = ‘1’ AND `date` > 1299875149 ORDER BY `name`
    Filename: libraries/Stats.php
    Line Number: 82

    I tried to repair the database tables through the CP tool as suggested in this old thread: http://ellislab.com/forums/viewreply/350264/

    It said it was corrupt and now, my CP and front-end are completely blank.

    Anything I can do? Thanks!

  • #2 / Mar 12, 2011 5:11pm

    John Henry Donovan

    12339 posts

    Hi Travis,
    Where originally did the error start to appear? The back or front end?
    What version and build of EE are you using?

    Have you got debug turned on in both your system index.php and your root index.php?
    It might show up an error for those blank pages.

    It looks like a permission issue.

    Can you add the following to your config.php and see if it gets your site back up at least.

    $config['enable_online_user_tracking'] = "n";

    Can you view the table via phpMyAdmin or similar?

  • #3 / Mar 13, 2011 2:48pm

    rockthenroll

    485 posts

    Hey John-

    That got both the front and back-end working again.

    I have Version 2.1.3 Build 20101220

    Initially it started on the front-end and I tried to logout ad back in, but then the CP was receiving it also.

    I can view it in phpMyAdmin and attempted to repair, but it was id was corrupted. Is there something specific I should look for?

    Thanks for the help!

  • #4 / Mar 14, 2011 8:58am

    Sue Crocker

    26054 posts

    Hi, Travis. I’d drop that table and re-create it. (After backing up the original table, of course.)

    CREATE TABLE exp_online_users (
                 online_id int(10) unsigned NOT NULL auto_increment,
                 site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
                 member_id int(10) default '0' NOT NULL,
                 in_forum char(1) NOT NULL default 'n',
                 name varchar(50) default '0' NOT NULL,
                 ip_address varchar(16) default '0' NOT NULL,
                 date int(10) unsigned default '0' NOT NULL,
                 anon char(1) NOT NULL,
                 PRIMARY KEY `online_id` (`online_id`),
                 KEY `date` (`date`),
                 KEY `site_id` (`site_id`)
                )

    I don’t know if you’ll still run into issues due to use Dropbox, but give it a try.

  • #5 / Mar 15, 2011 11:31am

    rockthenroll

    485 posts

    That did it. Thanks for the help, you’re both ninjas!

  • #6 / Mar 15, 2011 2:34pm

    Sue Crocker

    26054 posts

    We like being ninjas. 😊 Feel free to start a new thread if you have any more questions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases