SQLSTATE [42S02]:找不到基表或视图:

时间:2010-07-11 02:39:42

标签: magento

我正在通过新的结帐和导出/导入数据库将网站从我的开发服务器移动到公共网络服务器。之后,一切正常,除非有访问catalog_category模型的网站中断,并且在报告中存在以下错误:

   a:5:{i:0;s:113:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'openbox.catalog_category_entity_varchar' doesn't exist";i:1;s:2369:"#0 /lib/Zend/Db/Statement.php(305): Zend_Db_Statement_Pdo->_execute(Array)
   #1 /lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
   #2 /lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `attr_ta...', Array)
   #3 /lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `attr_ta...', Array)
   #4 /lib/Zend/Db/Adapter/Abstract.php(706): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
   #5 /app/code/local/Mage/Eav/Model/Entity/Abstract.php(851): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select))
   #6 /app/code/local/Mage/Catalog/Model/Resource/Eav/Mysql4/Abstract.php(587): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Category), 5, NULL)
   #7 /app/code/local/Mage/Core/Model/Abstract.php(223): Mage_Catalog_Model_Resource_Eav_Mysql4_Abstract->load(Object(Mage_Catalog_Model_Category), 5, NULL)
   #8 /app/code/local/Mage/Catalog/controllers/CategoryController.php(51): Mage_Core_Model_Abstract->load(5)
   #9 /app/code/local/Mage/Catalog/controllers /CategoryController.php(73): Mage_Catalog_CategoryController->_initCatagory()
   #10 /app/code/local/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
   #11 /app/code/local/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
   #12 /app/code/local/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
   #13 /app/code/local/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
   #14 /app/Mage.php(596): Mage_Core_Model_App->run(Array)
   #15 index.php(78): Mage::run('', 'store')

这是Magento 1.4.0.1版。我花了很多时间在网上进行研究,发现很多人都有类似的错误,但没有一个解决方案适用于我们的情况。

表'catalog_category_entity_varchar'与数据库中的条目一起存在。看起来magento正在为表添加前缀,即使在local.xml中没有指定表前缀。我认为这就是破坏。

您认为导致此错误的任何想法或指示?我应该在哪里看?

2 个答案:

答案 0 :(得分:1)

嗯,事实证明没有表'catalog_category_entity_varchar'并且它不是magento问题,但是具有不同版本的mysql数据库具有不同的语法。我的问题的解决方案在这里:

http://www.eliasinteractive.com/blog/magento-database-import-error-using-btree-key-fk_attribute_varchar_entity-entity_id-key-fk_catalo-at-line-9/comment-page-1#comment-3945

答案 1 :(得分:1)

试试这个

cd /magento/var/cache
rm -rf*