我最近创建了实时站点的数据库备份,以用于本地导入。导入数据库转储并尝试在本地运行Magento安装后,日志中出现很多错误,这些错误使我无法前进,也不知道从哪里开始。
这是日志的副本:
a:5:{i:0;s:96:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'us_magento.log_visitor' doesn't exist";i:1;s:3018:"#0 /Applications/MAMP/htdocs/mySite/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
1 /Applications/MAMP/htdocs/mySite/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
2 /Applications/MAMP/htdocs/mySite/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
3 /Applications/MAMP/htdocs/mySite/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
4 /Applications/MAMP/htdocs/mySite/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
5 /Applications/MAMP/htdocs/mySite/lib/Zend/Db/Adapter/Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
6 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(453): Zend_Db_Adapter_Abstract->insert('log_visitor', Array)
7 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor))
8 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Log/Model/Visitor.php(168): Mage_Core_Model_Abstract->save()
9 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Model/App.php(1338): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
10 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Log_Model_Visitor), 'initByRequest', Object(Varien_Event_Observer))
11 /Applications/MAMP/htdocs/mySite/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
12 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Controller/Varien/Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
13 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Controller/Front/Action.php(64): Mage_Core_Controller_Varien_Action->preDispatch()
14 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Core_Controller_Front_Action->preDispatch()
15 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
16 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
17 /Applications/MAMP/htdocs/mySite/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
18 /Applications/MAMP/htdocs/mySite/app/Mage.php(683): Mage_Core_Model_App->run(Array)
19 /Applications/MAMP/htdocs/mySite/index.php(94): Mage::run('', 'store')
20 {main}";s:3:"url";s:21:"/mySite/";s:11:"script_name";s:30:"/mySite/index.php";s:4:"skin";s:7:"default";}
答案 0 :(得分:0)
问题很明显,表us_magento.log_visitor
丢失了。
您的数据库转储有一个问题,那就是没有将所有表都带到一起,或者您的本地Magento安装中存在配置问题。
在导入后检查您的本地数据库,并查找表log_visitor
。
另外,检查您在文件夹local.xml
中可以找到的Magento MAGENTO_ROOT/app/etc
文件。
检查local.xml
文件上的数据库配置,并确保使用相同的数据库名称us_magento
。