Bug #342
SQL Inconsistency Causing Magento To Fail Loading
Description
I encountered a problem where the parts mirror site would not load correctly. I checked the log file and found the following error:
a:5:{i:0;s:117:"SQLSTATE[HY000]: General error: 145 Table './exampledb/log_visitor_info' is marked as crashed and should be repaired";i:1;s:3131:"#0 /var/www/user/web/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
After looking through a Magento forum, I found a fix. First log into the database server:
ssh root@db.example.com
Then change to the physical folder of the problem database:
cd /var/lib/mysql/exampledb
Then run myisamchk:
myisamchk -r *.MYI
This will fix any problems to the MySQL index. I restarted the database to be on the safe side:
service mysql restart