im new to magento

I have magento installation ( magento 1.9.1 , MySQL 5.5.40-36.1 , PHP: 5.4.38 , Apache: 2.2.29 ) im unable to reindex my product flat data from the magento backend and my magento search is also not working.

for the 1st part i have tried all the methods give in this blog http://webexplorar.com/magento-reindexing-problems-solutions/

have tried doing it by truncating catalog_Product_flat_data and then re indexing it , also tried reindexer script, when i used this script i got this error -

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'studentb_one.#sql-7ecb_1ea14b6' (errno: 121)' in /home4/studentb/public_html/lib/Zend/Db/Statement/Pdo.php:228 
Stack trace: #0 /home4/studentb/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) 
#1 /home4/studentb/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) 
#2 /home4/studentb/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home4/studentb/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) 
#4 /home4/studentb/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Array) 
#5 /home4/studentb/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...', Array) 
#6 /home4/studentb/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(347): Varien_Db_Adapt in /home4/studentb/public_html/lib/Zend/Db/Statement/Pdo.php on line 228

also have tried switching the search types in the magento backend

have read about the foreign key disable and enable , can that also solve this issue.

please help...

also want to know what is this error and upon solving this error will the search work properly??

Thanks in advance

  • What are you exactly doing to get this error? This error should appear anytime you try to load your site, not just when re-indexing.
    – laketuna
    Commented Mar 21, 2015 at 18:27
  • well i was trying a bunch of things for reindexing, i got this error when i ran an indexing script " <?php require_once 'app/Mage.php'; $app = Mage::app('admin'); umask(0); for ($index = 1; $index <= 8; $index++) { $process = Mage::getModel('index/process')->load($index); $process->reindexAll(); } ?>" Commented Mar 21, 2015 at 18:40
  • What happens when you load your website on the browser, go to the admin panel, etc.?
    – laketuna
    Commented Mar 21, 2015 at 18:50
  • it loads perfectly fine , all the products active products and categories Commented Mar 21, 2015 at 19:10

1 Answer 1


It seems like an extension installation script rather than an indexing problem. However, from your comment, it also seems like perhaps there's an extension that creates a table when you reindex (possibly just a temporary table for reindexing).

In any case, one of your extensions is trying to install a table called #sql-7ecb_1ea14b6 (what a strange name for a table) with a foreign key constraint whose name is identical to another FK constraint. You'll need to change this name in the script that installs #sql-7ecb_1ea14b6.

  1. Find out which extension has this installation script or tries to create this table.

  2. Look in the sql directory and find the script that tries to install that table. Alternatively, find the extension and search for anything resembling below. Note the name in the following section..


  3. Do a string search on your entire app directory and find out the other extension that already used this name.

You can also run the following query to see all of the contraints. THIS_IS_THE_FOREIGN_KEY_CONTRAINT_NAME should already be present in this list.

SELECT constraint_name,table_name
FROM information_schema.table_constraints 
WHERE constraint_type = 'FOREIGN KEY' 
    AND table_schema = DATABASE() 
ORDER BY constraint_name;

Note: I suspect there may be other problems, but this should fix your immediate issue.

  • i tried searching but the search on the data base came empty, im trying the string search on the sql directory of this table name #sql-7ecb_1ea14b6 Commented Mar 22, 2015 at 7:30
  • This is all I can give you with the information I have. I updated my answer slightly.
    – laketuna
    Commented Mar 23, 2015 at 13:38

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