0

I'm trying to re-index the category flat data, but I am always met with the same error:

There was a problem with reindexing process. Error Message: SQLSTATE[HY000]: General error: 1005 Can't create table 'xxx.catalog_category_flat_store_6' (errno: 121)

The table doesn't exist, there is a 1 and a 7. Not sure if that makes a difference?

After running the query manually through phpMyAdmin, I am met with the MySQL error 121. I've checked around and this would suggest the names of the foreign keys trying to be created already exist. I've listed all foreign keys in the DB right now, and they don't exist at all.

I've also tried running SHOW ENGINE INNODB STATUS on the DB for more information, but we don't have the rights to view that apparently.

BenOfTheNorth
  • 2,904
  • 1
  • 20
  • 46

2 Answers2

1

After getting the priv's updated so we could run SHOW INNODB STATUS, we discovered that we already had an existing index that was attempting to be duplicated with this new table. This stemmed from us backing up an older version of the table that was trying to be created. Deleting that copy of the table enabled Magento to re-index properly and solved our problem.

BenOfTheNorth
  • 2,904
  • 1
  • 20
  • 46
0

Try logging the sql commands and debug what its trying to do by executing them manually. On the index process, normally there is a command that clears a table, and another to recreate it.

Edit /magentoRoot/lib/Varien/Db/Adapter/Pdo/Mysql.php and change $_debug to true and note the $_debugFile location (should be var/debug/pdo_mysql.log)

Its best to edit the file in vi, have a browser open to reindex JUST the category data, save the file in vi :w! and then run the indexer then change the debug back to false.

Then go read the log. It may help.

CarComp
  • 1,929
  • 1
  • 21
  • 47
  • Thanks! It didnt show any more error information, however it did provide the query. I tried running it manually, and it gave me a mysql error of 121 – BenOfTheNorth Feb 28 '13 at 13:57