How to repair a MySQL table?
Posted on In QAAfter 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:
-
Connect to the MySQL management console (through the mysql command) to the MySQL DB.
-
Choose the DB by executing:
use mybb;
-
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:
-
Access phpMyAdmin
-
Select your the mybb database
-
Click on the “SQL” tab on the right side
-
Type in the following SQL and execute it
repair table mybb_session;