Was updating my indexes and noticed that one had failed, upon further investigation it looks like catalog_product_flat throws the following exception:

exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table ie2837g324t34t43r87g.sql-4416_38f7 (errno: 121 "Duplicate key on write or update")' in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228

Does someone have a statement I can run to resolve this error? or Should I drop the catalog_product_flat table and re-index to recreate it?

EDIT: Just tried running the repair tool and it says

enter image description here

I know I'm not the only one to have this because Google leads to links back to the old magento forum or people post that they fixed the issue but didn't outline what they've done.


1 Answer 1


It looks like the catalog_product_flat tables became corrupted. Doing repairs with mysqlcheck and phpmyadmin didn't work because they are not supported by InnoDB.

To work around this issue, first backup your database.

Then run the following statement on your database to change the engine from InnoDB to MyISAM.

ALTER TABLE catalog_product_flat ENGINE = MyISAM;

Run a repair on these tables.

Run the indexer for catalog_product_flat and it should complete successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.