SQLSTATE [42S02]:未找到基本表或视图:
问题描述:
我通过执行新签出和导出/导入数据库,将网站从开发服务器移动到公共Web服务器。此后,一切正常,除非有一个访问catalog_category模式的网站场所及有以下错误报告:SQLSTATE [42S02]:未找到基本表或视图:
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中没有指定表前缀。我认为这就是打破。
任何想法或指针你认为是这个错误的原因?我应该在哪里看?
答
那么,事实证明,没有表'catalog_category_entity_varchar',它不是magento问题,但具有不同版本的mysql数据库具有不同的语法。我的问题的解决方案是在这里:
答
试试这个
cd /magento/var/cache
rm -rf*