Magento reindex类别平面数据不起作用

时间:2015-02-10 15:28:58

标签: mysql magento

终于有了我们客户的Magento网站的本地版本,我现在已经能够更接近解决他们的问题了。我们无法重新索引类别平面数据。

查看日志时,重建索引时会出现创建外键的问题,这会消除mage_catalog_category_flat_store_1表,从而导致整个站点中断。

但是,我不太清楚为什么无法创建外键,因为db用户具有完全访问权限。日志文件包含以下内容:

2015-02-10T14:38:27+00:00 DEBUG (7): Exception message: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
Trace: #0 Z:\XAMPP\htdocs\sites\Providore\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 Z:\XAMPP\htdocs\sites\Providore\lib\Zend\Db\Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 Z:\XAMPP\htdocs\sites\Providore\lib\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 Z:\XAMPP\htdocs\sites\Providore\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `m...', Array)
#4 Z:\XAMPP\htdocs\sites\Providore\lib\Varien\Db\Adapter\Pdo\Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `m...', Array)
#5 Z:\XAMPP\htdocs\sites\Providore\lib\Varien\Db\Adapter\Pdo\Mysql.php(2039): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `m...')
#6 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Catalog\Model\Resource\Category\Flat.php(604): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))
#7 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Catalog\Model\Resource\Category\Flat.php(1418): Mage_Catalog_Model_Resource_Category_Flat->_createTable('1')
#8 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Catalog\Model\Resource\Category\Flat.php(1431): Mage_Catalog_Model_Resource_Category_Flat->_createTables()
#9 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Catalog\Model\Category\Indexer\Flat.php(246): Mage_Catalog_Model_Resource_Category_Flat->reindexAll()
#10 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Index\Model\Process.php(209): Mage_Catalog_Model_Category_Indexer_Flat->reindexAll()
#11 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Index\Model\Process.php(255): Mage_Index_Model_Process->reindexAll()
#12 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Index\controllers\Adminhtml\ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#13 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Varien\Action.php(419): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#14 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#15 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 Z:\XAMPP\htdocs\sites\Providore\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#17 Z:\XAMPP\htdocs\sites\Providore\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#18 Z:\XAMPP\htdocs\sites\Providore\index.php(90): Mage::run('', 'store')
#19 {main}

任何人都可以解释我需要做些什么才能让重建索引工作?在我们完成此工作之前,网站后端的类别与网站前端导航中的类别不匹配。

提前致谢

1 个答案:

答案 0 :(得分:2)

禁用平面表:

System > Configuration > Catalog > Frontend 
Disable Use Flat Catalog Category and Use Flat Catalog Product.

截断你的平台。

现在应该可以正常工作,没有平板。现在你可以再次启用flat,并重新索引以构建它。