1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do you suggest to prevent crashed MyISAM table?

Discussion in 'Site & Server Administration' started by postcd, Oct 18, 2019.

  1. #1
    On my site was an error:
    General Error SQL ERROR [ mysqli ] - Table 'phpbb_sessions' is marked as crashed and should be repaired

    I could click to repair that table in mysql manager - PHPMyAdmin and that fixed it. Also the command is: REPAIR TABLE phpbb_sessions;

    But the question is how to prevent it. Someone said that MyISAM tables crash like this due to something unexpected, like a server failure, out of memory/disk space or breakdown. There is nothing i can do to prevent it if i am not a server admin. What if i am?
    Or maybe if i am just a shared hoting user with basic SSH access and cronjob, i can run a cron task executing a bash script containing: mysqlcheck -C / mysqlcheck -c

    If my server support InnoDB, should i convert just this one table (i found this one to be only one that gets crashed from time to time)?
    I found SQL command: ALTER TABLE table_name ENGINE=InnoDB;
    I would backup table_name before running that.
    SEMrush
     
    postcd, Oct 18, 2019 IP
    SEMrush
  2. WebPeer

    WebPeer Peon

    Messages:
    5
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    3
    #2
    Maybe you could ask the hosting provider to move your site to another node if your current one has hardware issues.
     
    WebPeer, Dec 15, 2019 IP
  3. tuxandrew

    tuxandrew Active Member

    Messages:
    63
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    68
    #3
    >> General Error SQL ERROR [ mysqli ] - Table 'phpbb_sessions' is marked as crashed and should be repaired

    As mentioned it is a general error, unable to guess what exactly caused this.

    Possibilities:

    - Disk quota issues
    - Any sudden server reboots or database server restart.
    - Server running with resource shortage for long time
    - Unoptimized MysQL server
    - Unoptimized application/queries
    - Low physical memory(OOM error).

    1. You should consult your host for a detailed investigation up on errors to ensure that it is not a hardware issue or an issues with any other underlying softwares on server supporting the application. If it is hardware or the server, then you can switch to a better server.
    2. If not, it is application or database related, then you need seek assistance from developer's.
    3. Please note that you should backup the code as well as database before making any changes to an active website.
     
    tuxandrew, Dec 24, 2019 IP
    postcd likes this.