magento -- 服务器重启或mysql重启后,magento网站出现表破坏()问题的解决

 

 重启服务器后或重启mysql后有时候会发现,magento做的网站打开时出现数据库表损坏的错误提示,如:

 

SQLSTATE[HY000]: General error: 145 Table ‘./abc /log_visitor’ is marked as crashed and should be repaired

Trace:
#0 /shares/websites/xxxxxxx.com/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /shares/websites/www.supercamper.co.uk/lib/Zend/Db/Adapter/Abstract.php(406): Zend_Db_Statement->execute(Array)
#2 /shares/websites/www.supercamper.co.uk/lib/Zend/Db/Adapter/Pdo/Abstract.php(206): Zend_Db_Adapter_Abstract->query(’INSERT INTO `lo...’, Array)
#3 /shares/websites/www.supercamper.co.uk/lib/Zend/Db/Adapter/Abstract.php(484): Zend_Db_Adapter_Pdo_Abstract->query(’INSERT INTO `lo...’, Array)
#4 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(343): Zend_Db_Adapter_Abstract->insert(’log_visitor’, Array)
#5 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Model/Abstract.php(235): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Log_Model_Visitor))
#6 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Log/Model/Visitor.php(136): Mage_Core_Model_Abstract->save()
#7 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Model/App.php(1032): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#8 /shares/websites/www.supercamper.co.uk/app/Mage.php(278): Mage_Core_Model_App->dispatchEvent(’controller_acti...’, Array)
#9 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Controller/Varien/Action.php(377): Mage::dispatchEvent(’controller_acti...’, Array)
#10 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Controller/Front/Action.php(40): Mage_Core_Controller_Varien_Action->preDispatch()
#11 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Controller/Varien/Action.php(335): Mage_Core_Controller_Front_Action->preDispatch()
#12 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(159): Mage_Core_Controller_Varien_Action->dispatch(’index’)
#13 /shares/websites/www.supercamper.co.uk/app/code/core/Mage/Core/Controller/Varien/Front.php(146): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /shares/websites/www.supercamper.co.uk/app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch()
#15 /shares/websites/www.supercamper.co.uk/index.php(40): Mage::run(’default’)
#16 {main}

 

 

进入mysql数据库的数据目录,通常是/var/lib/mysql,如果你不确定,或者此目录不存在,你可以通过查看mysql的配置文件或其它方式来获取.

 

然后执行下面的命令

 

myisamchk -r *.MYI

 

即可修复好magento数据库中由于mysql服务器重启破坏的表结构.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值