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.

Database nightmare: MySQL table crashes all the time

November 02, 2008 12:52pm

Subscribe [2]
  • #1 / Nov 02, 2008 12:52pm

    dmitrybelyakov

    37 posts

    Hello,

    I’m experiencing a problem with MySQL that causes several tables to CRASH all the time. I cannot localaze it to any particular piece of code that is causing this since the CodeIgniter user session table crashes all the time also.

    So i guess it’s not coding problem.  I would appreciate any help or sugestions how can we debug and fix this.


    Thanks!

  • #2 / Nov 02, 2008 1:27pm

    Developer13

    574 posts

    1 - What indicates to you that the tables are “crashing”?

    2 - Have you looked through any log files?

  • #3 / Nov 02, 2008 1:42pm

    dmitrybelyakov

    37 posts

    1 - What indicates to you that the tables are “crashing”?

    2 - Have you looked through any log files?

    1. Well - i get a CI error saying that table user_seccions had crashed and should be repaired. I then go to phpMyAdmin to fix this - it shows tha table as crashed also.

    2. I don’t know what log files can I search for this.


    And by the way - it’s not only CI tables that are crashing. One of my own table crashes all the time too.

    Seems to me that it’s a sort of mysql cuncurrency issue. Or CI database class issue. I don’t know….

    P.S. MySQL version 4.0.24 And web werver is NOT Apache

  • #4 / Nov 02, 2008 1:47pm

    Developer13

    574 posts

    See http://dev.mysql.com/doc/refman/4.1/en/log-files.html for details on the log files.  That’s definitely the first place I would start.  Also, you may want to check the ‘Status’ tab in phpMyAdmin and see if you find anything strange there.

  • #5 / Nov 02, 2008 2:50pm

    dmitrybelyakov

    37 posts

    OK, I now go look at status & try to get mysql logs at shared hosting provider.
    Will post back here what i discovered.

    The exact error ‘users_sessions’ table is showing upon crash is:

    Error Number: 126
    Incorrect key file for table ‘./z100869_rg/users_sessions.MYI’; try to repair it
    DELETE FROM `users_sessions` WHERE `last_activity` < 1225644209

  • #6 / Nov 02, 2008 3:02pm

    Developer13

    574 posts

    When the table crashes, do you run a repair on the table through phpMyAdmin?

    If you do, and then it works for a while and crashes again, here are a few things I would suggest:

    1 - Try deleting and recreating the indexes (I doubt this will permanently fix it, but it won’t hurt to try).

    2 - Your host’s hard drive might be crashing or have bad blocks.

    3 - If the host has some strange database setup, there may be an associated bug with the way they have it set up and MySQL 4.0.xx.

    Who is your host?

  • #7 / Nov 02, 2008 9:52pm

    Adam :: Envise

    8 posts

    It won’t be a CI issue, as the database class will simply be returning the error given by MySQL.

    If you are hosting this with a hosting company (rather than hosting it yourself), I’d get in contact with them and ask if they can fix the problem, and advise you what the issue was.

    In any case, hopefully with their experience, they will be able to tell you the issues, and recommend the best solution to stop it from occurring again.

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

ExpressionEngine News!

#eecms, #events, #releases