magento 1.7.0.2 SQLSTATE [HY000]:一般错误:1005无法创建表' irtto.catalog_product_flat_5'

时间:2014-05-26 06:23:11

标签: mysql magento

我手动刷新了Product_Flat_Data索引,但是没有成功。我得到以下例外情况:

[root@www shell]# /www/wdlinux/php/bin/php -f indexer.php -- -reindex catalog_product_flat
Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'irtto.catalog_product_flat_5' (errno: 150)' in /home/www/irtto/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/www/irtto/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/www/irtto/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/www/irtto/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/www/irtto/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/www/irtto/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#5 /home/www/irtto/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#6 /home/www/irtto/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(2039): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#7 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(702): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))
#8 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(1390): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(5)
#9 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296): Mage_Catalog_Model_Resource_Product_Flat_Indexer->reindexAll()
#10 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(336): Mage_Catalog_Model_Product_Flat_Indexer->reindexAll()
#11 /home/www/irtto/public_html/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#12 /home/www/irtto/public_html/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#13 /home/www/irtto/public_html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#14 /home/www/irtto/public_html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#15 {main}

下一个例外

'Zend_Db_Statement_Exception' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'irtto.catalog_product_flat_5' (errno: 150)' in /home/www/irtto/public_html/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /home/www/irtto/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/www/irtto/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/www/irtto/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/www/irtto/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#4 /home/www/irtto/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#5 /home/www/irtto/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(2039): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#6 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(702): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))
#7 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(1390): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(5)
#8 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296): Mage_Catalog_Model_Resource_Product_Flat_Indexer->reindexAll()
#9 /home/www/irtto/public_html/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(336): Mage_Catalog_Model_Product_Flat_Indexer->reindexAll()
#10 /home/www/irtto/public_html/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#11 /home/www/irtto/public_html/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#12 /home/www/irtto/public_html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#13 /home/www/irtto/public_html/shell/indexer.php(198): Mage_Shell_Compiler->run()
#14 {main}

1 个答案:

答案 0 :(得分:1)

您在indexer.php(/ www / wdlinux / php / bin / php -f indexer.php)中使用的mysql用户没有对数据库的写权限。授予该用户写入权限。