Rigorous and Reliable (RAR)

Full Version: mybb_sessions crashed and need repaired
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

amoners

error info is
Code:
MyBB has experienced an internal SQL error and cannot continue.

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

The error like below:
[attachment=2630]


How to fix it:

1. log in on host of mybb forum

2. log in(e.g. user: test, password: test) mysql of mybb forum

Code:
mysql -u  test -p test

3. change to database(e.g. test) which it use.

Code:
use test;

4. repair it by command like below:

Code:
repair table `mybb_sessions`;

The results of this command like below:

Code:
mysql> repair table `mybb_sessions`;
+--------------------+--------+----------+--------------------------------------------+
| Table              | Op     | Msg_type | Msg_text                                   |
+--------------------+--------+----------+--------------------------------------------+
| test.mybb_sessions | repair | warning  | Number of rows changed from 10489 to 10486 |
| test.mybb_sessions | repair | status   | OK                                         |
+--------------------+--------+----------+--------------------------------------------+
2 rows in set (0.26 sec)

You can try to access website again to test it work or not.

note: root password is in /var/www/html/inc/config.php
---
20210804/zhihao: update root password location
20210804/zhihao: add error info

zhihao

error info is
Code:
MyBB has experienced an internal SQL error and cannot continue.

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

zhihao

note: root password is in /var/www/html/inc/config.php

zhihao

rar meets table crashed
Code:
MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    145 - Table './tests/mybb_sessions' is marked as crashed and should be repaired
Query:
    SELECT * FROM mybb_sessions WHERE sid='89436e8043247b0d666cac55e895cf49' AND ip='183.17.230.152' LIMIT 1

Please contact the MyBB Group for support.

fix it
Code:
mysql> use tests
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> repair table mybb_sessions;
+---------------------+--------+----------+------------------------------------------+
| Table               | Op     | Msg_type | Msg_text                                 |
+---------------------+--------+----------+------------------------------------------+
| tests.mybb_sessions | repair | warning  | Number of rows changed from 9918 to 9917 |
| tests.mybb_sessions | repair | status   | OK                                       |
+---------------------+--------+----------+------------------------------------------+
2 rows in set (0.29 sec)
20250626/lingu tries to repair it
Code:
[lingu@forumvrs2e3 ~]$ mysql -u test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 95
Server version: 5.1.47 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> repair table 'mybb_sessions';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''mybb_sessions'' at line 1
mysql> repair table `mybb_sessions`;
+--------------------+--------+----------+--------------------------------------------+
| Table              | Op     | Msg_type | Msg_text                                   |
+--------------------+--------+----------+--------------------------------------------+
| test.mybb_sessions | repair | warning  | Number of rows changed from 10288 to 10285 |
| test.mybb_sessions | repair | status   | OK                                         |
+--------------------+--------+----------+--------------------------------------------+
2 rows in set (0.34 sec)

mysql>
Reference URL's