Magento - 无法重新索引产品价格 - 外键约束失败 [英] Magento - Unable to reindex Product Prices - Foreign Key Constraint Fails

查看:209
本文介绍了Magento - 无法重新索引产品价格 - 外键约束失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚把我的magento商店从1.4.2升级到1.7.0.2 ..升级进行的很顺利,但是当我尝试升级后重新索引数据的时候..它在产品价格上失败了..



我试过从SSH使用 php shell / indexer.php --reindexall 错误(我使用pastebin作为错误是相当长的):



http://pastebin.com/iV2tuzDX



我可以看到,表 catalog_product_index_tier_price 是空的..我不知道这是否导致任何问题?

我已经尝试了许多不同的解决方法,但无济于事。 :





没有一个能工作..我不是MySQL的专家,但我知道一点点..所以我希望有人能够找出是什么原因造成的错误,并帮助我,我相信这也可以帮助别人遇到同样的问题,我:)



谢谢!〜

解决方案


$ b

请执行以下操作:

通过
lib / Varien / Db / Adapter / Pdo / Mysql.php。在第86行左右,你会看到下面的类变量:

$ p $ protected $ _debug = false;
保护$ _logAllQueries = false;
保护$ _logCallStack = false;
protected $ _debugFile ='var / debug / sql.txt';

全部更改为true,然后运行重新索引。然后检查上面指定的日志文件。

日志文件指示数据库中的哪个表导致问题,然后将此表的表结构与此处的表的结构进行比较: http://www.magereverse.com/ index / magento-database-diagram / version / 1-7-0-2



删除不应该在那里的列。
问题将被修复。
问候。


I've just recently upgraded my magento store from 1.4.2 to 1.7.0.2.. And The upgrade went smoothly but when I try to reindex data after the upgrade.. It fails on the Product Prices..

I've tried using php shell/indexer.php --reindexall from SSH and it fails at the Product Prices with these errors (I use pastebin as the error are quite long):

http://pastebin.com/iV2tuzDX

From what I can see, the table catalog_product_index_tier_price is empty.. and I'm not sure if that is causing any issue?

I've tried many different ways of solving it but to no avail.. Things like:

None of them worked.. I am not an expert in MySQL but I do know a little bit.. So I hope someone is able to find out what is causing the error and help me out and I believe it might also help others too who are experiencing the same issue as me :)

Thanks!~

解决方案

Solution :

Please carry out the following :

Enable magento DB logging via: lib/Varien/Db/Adapter/Pdo/Mysql.php . Down around line 86, you’ll see the following class variables:

protected $_debug = false; 
protected $_logAllQueries = false; 
protected $_logCallStack = false; 
protected $_debugFile = ‘var/debug/sql.txt’;

Change all to true and then run the re-index. Then check the log file specified above.

The log file indicates which table in the database is causing the issue and then compare the table structure of this table with the same one here: http://www.magereverse.com/index/magento-database-diagram/version/1-7-0-2

Remove the column that shouldn't be there. The issue will be fixed. Regards.

这篇关于Magento - 无法重新索引产品价格 - 外键约束失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆