gpt4 book ai didi

mysql - Magento 重新索引目录产品平面错误 : Error in foreign key constraint

转载 作者:行者123 更新时间:2023-11-29 20:27:26 24 4
gpt4 key购买 nike

当我尝试重新索引 Magento 1.7 目录产品平面索引(通过管理面板或命令行)时出现错误。

在命令行上我收到以下错误:

Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005
Can't create table 'databasename.#sql-340a_22a3' (errno: 121)' in
/var/www/clients/client1/web16/web/lib/Zend/Db/Statement/Pdo.php:228

当我使用“SHOW ENGINE INNODB STATUS;”查看 mysql 时,出现以下错误:

160830 10:17:09 Error in foreign key constraint creation for table
`databasename`.`#sql-340a_2160`.
A foreign key constraint of name
`databasename`.`FK_MAGE_MAGE_CAT_PRD_FLAT_1_ENTT_ID_MAGE_CAT_PRD_ENTT_ENTT_ID`
already exists. (Note that internally InnoDB adds 'databasename'
in front of the user-defined constraint name.)
Note that InnoDB's FOREIGN KEY system tables store
constraint names as case-insensitive, with the
MySQL standard latin1_swedish_ci collation. If you
create tables or databases whose names differ only in
the character case, then collisions in constraint
names can occur. Workaround: name your constraints
explicitly with unique names.

知道如何解决这个问题吗?

最佳答案

在重新索引之前禁用 foreign_key_checks MySQL 选项

SET foreign_key_checks = 0;
// job
SET foreign_key_checks = 1;

关于mysql - Magento 重新索引目录产品平面错误 : Error in foreign key constraint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39222416/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com