How to repair a MySQL table?

After a server crash and restarting, MyBB reports a SQL Error as follows:

MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
145 - Table './mybb/mybb_sessions' is marked as crashed and should be repaired
Query:
SELECT * FROM mybb_sessions WHERE sid='40021925bd0494ea31...' AND ip='x.x.x.x' LIMIT 1

The dababase is MySQL. Please help. Thank you!

You can repair the table following these steps:

  1. Connect to the MySQL management console (through the mysql command) to the MySQL DB.

  2. Choose the DB by executing:

    use mybb;

  3. repair the mybb_sessions table by executing:

    repair table mybb_sessions;

If you can not use the console, you can execute the SQL in phpMyAdmin:

  1. Access phpMyAdmin

  2. Select your the mybb database

  3. Click on the “SQL” tab on the right side

  4. Type in the following SQL and execute it

    repair table mybb_session;

Similar Posts

  • Question2answer: show excerpt in the RSS feed

    There is a “Include full text in feeds:” option in the “RSS feeds” configuration panel but no options/method to only show excerpt instead of the “full text” or nothing for RSS feeds. This need to hack the question2answer source code. Details are in the answer. The changes based on Question2asnwer 1.5.4: diff –git a/qa-include/qa-index.php b/qa-include/qa-index.php…

  • How to change strings in MySQL tables

    How to change strings in MySQL tables? e.g. I want to change domain.com to www.domain.com. Use the REPLACE functions of MySQL: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace One example is like this: UPDATE table SET field = REPLACE(field, ‘domain.com’, ‘www.domain.com’) WHERE field LIKE ‘%domain.com%’ The WHERE clause is not needed but can make execution faster. Read more: How to find…

  • How to force a checkpointing of metadata in HDFS?

    HDFS SecondaraNameNode log shows 2017-08-06 10:54:14,488 ERROR org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Exception in doCheckpoint java.io.IOException: Inconsistent checkpoint fields. LV = -63 namespaceID = 1920275013 cTime = 0 ; clusterId = CID-f38880ba-3415-4277-8abf-b5c2848b7a63 ; blockpoolId = BP-578888813-10.6.1.2-1497278556180. Expecting respectively: -63; 263120692; 0; CID-d22222fd-e28a-4b2d-bd2a-f60e1f0ad1b1; BP-622207878-10.6.1.2-1497242227638. at org.apache.hadoop.hdfs.server.namenode.CheckpointSignature.validateStorageInfo(CheckpointSignature.java:134) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doCheckpoint(SecondaryNameNode.java:531) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doWork(SecondaryNameNode.java:395) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode$1.run(SecondaryNameNode.java:361) at org.apache.hadoop.security.SecurityUtil.doAsLoginUserOrFatal(SecurityUtil.java:415) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.run(SecondaryNameNode.java:357) It seems the checkpoint…

  • How to avoid mounting failures blocking Linux booting?

    Some entries in /etc/fstab may not not critical for booting Linux or even not available until Linux has booted. How to avoid the failures or unavailability of some mounting entries in /etc/fstab blocking the boot process of Linux? Please check the tutorial at Controlling Filesystem Mounting on Linux by Playing with /etc/fstab: Allow non-root users…

Leave a Reply

Your email address will not be published. Required fields are marked *