重新索引扁平产品数据时出错
我收到此错误“重新索引过程出现问题。”在 Magento 中,当我尝试在产品平面数据中重新索引数据时。 我使用 Magento 1.4.1.1,数据库中有超过 50 000 个项目。
有办法解决这个问题吗?
以下是我在Exception.log中发现的错误:
2011-04-14T19:24:05+00:00 DEBUG (7): Exception message: SQLSTATE[HY000]: General error: 1005 Can't create table 'magentonou.catalog_product_flat_3' (errno: 150)
Trace: #0 E:\Wamp\www\includes\src\__default.php(48621): Zend_Db_Statement_Pdo->_execute(Array)
#1 E:\Wamp\www\includes\src\__default.php(40291): Zend_Db_Statement->execute(Array)
#2 E:\Wamp\www\includes\src\__default.php(41312): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#3 E:\Wamp\www\includes\src\__default.php(42062): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#4 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(544): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#5 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(122): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->prepareFlatTable('3')
#6 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(115): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild('3')
#7 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Flat_Indexer.php(64): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild(NULL)
#8 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Indexer_Flat.php(301): Mage_Catalog_Model_Product_Flat_Indexer->rebuild()
#9 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(139): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#10 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(167): Mage_Index_Model_Process->reindexAll()
#11 E:\Wamp\www\app\code\core\Mage\Index\controllers\Adminhtml\ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#12 E:\Wamp\www\includes\src\__default.php(11748): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 E:\Wamp\www\includes\src\__default.php(15669): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 E:\Wamp\www\includes\src\__default.php(15271): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 E:\Wamp\www\includes\src\__default.php(17470): Mage_Core_Controller_Varien_Front->dispatch()
#16 E:\Wamp\www\app\Mage.php(596): Mage_Core_Model_App->run(Array)
#17 E:\Wamp\www\index.php(80): Mage::run('', 'store')
#18 {main}
I receive this error "There was a problem with reindexing process." in Magento when I try to Reindex Data at Product Flat Data.
I use Magento 1.4.1.1, and I have over 50 000 itemes in database.
Is a way to fix this?
Here are the errors what I find in exception.log:
2011-04-14T19:24:05+00:00 DEBUG (7): Exception message: SQLSTATE[HY000]: General error: 1005 Can't create table 'magentonou.catalog_product_flat_3' (errno: 150)
Trace: #0 E:\Wamp\www\includes\src\__default.php(48621): Zend_Db_Statement_Pdo->_execute(Array)
#1 E:\Wamp\www\includes\src\__default.php(40291): Zend_Db_Statement->execute(Array)
#2 E:\Wamp\www\includes\src\__default.php(41312): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#3 E:\Wamp\www\includes\src\__default.php(42062): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#4 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(544): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#5 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(122): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->prepareFlatTable('3')
#6 E:\Wamp\www\includes\src\Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer.php(115): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild('3')
#7 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Flat_Indexer.php(64): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Flat_Indexer->rebuild(NULL)
#8 E:\Wamp\www\includes\src\Mage_Catalog_Model_Product_Indexer_Flat.php(301): Mage_Catalog_Model_Product_Flat_Indexer->rebuild()
#9 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(139): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#10 E:\Wamp\www\includes\src\Mage_Index_Model_Process.php(167): Mage_Index_Model_Process->reindexAll()
#11 E:\Wamp\www\app\code\core\Mage\Index\controllers\Adminhtml\ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#12 E:\Wamp\www\includes\src\__default.php(11748): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 E:\Wamp\www\includes\src\__default.php(15669): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 E:\Wamp\www\includes\src\__default.php(15271): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 E:\Wamp\www\includes\src\__default.php(17470): Mage_Core_Controller_Varien_Front->dispatch()
#16 E:\Wamp\www\app\Mage.php(596): Mage_Core_Model_App->run(Array)
#17 E:\Wamp\www\index.php(80): Mage::run('', 'store')
#18 {main}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我记得有一个数据库修复工具可以从 Varien 下载。
是的,检查过。它仍然存在:链接
我大约一年前在 Magento 1.3.x 中使用了该工具,并且能够修复数据库成功。
但我不知道它是否可以用于 1.4.x。不幸的是,他们没有说明该工具可以用于哪些版本。也许源代码中有说明。
编辑:
来源: dev.mysql.com
I remember a database repair tool you could download from Varien.
Yeah, checked it. It still exists: Link
I used that tool about a year ago with Magento 1.3.x and was able to repair a database with it successfully.
I do not know, if it can be used for 1.4.x, though. They unfortunately do not state for which versions the tool can be used. Maybe it's stated in the source code.
EDIT:
Source: dev.mysql.com
解决方案
查看catalog_eav_attribute 和eav_attribute 表。对于设置为 1 的所有用户定义字段,将used_in_product_listing 字段更新为 0。在运行此命令之前,请使用 SELECT 子句并查看其提取哪些字段。另外,先在测试环境上运行!!
...并且已修复!
Solution
Take a look at the catalog_eav_attribute and eav_attribute tables. Update the used_in_product_listing field to 0 for all user defined fields that are set to 1. Before running this, use a SELECT clause and see what fields its pulling out. Also, run on a test environment first!!
…and Fixed!