2012-12-11 58 views
1

所有的指令說:http://turnkeye.com/blog/magento-upgrade-guide/ (這不是官方的Magento網站,但它是指這一點)。Magento 1.4.0.1 - > 1.7 MySQL錯誤150

我有自己

現在升級已完成,您可以執行數據庫升級訪問你的Magento商店在瀏覽器中,這個過程將需要幾分鐘,請耐心等待。

然後得到了mysql錯誤。谷歌不知道這個問題的確切內容。如果你知道某事,請幫忙。

我的錯誤日誌:

a:5:{i:0;s:245:"Error in file: "/home/mysite/public_html/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.7-1.4.0.0.8.php" - SQLSTATE[HY000]: General error: 1005 Can't create table './mysite_magento/customer_form_attribute.frm' (errno: 150)";i:1;s:978:"#0 /home/mysite/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...') 
#1 /home/mysite/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.4.0.0.6', '1.6.2.0.1') 
#2 /home/mysite/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.4.0.0.6', '1.6.2.0.1') 
#3 /home/mysite/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates() 
#4 /home/mysite/public_html/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates() 
#5 /home/mysite/public_html/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules() 
#6 /home/mysite/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array) 
#7 /home/mysite/public_html/index.php(87): Mage::run('', 'store') 
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";} 

我發現確切的代碼,應該使表customer_form_attribute,並試圖exewcute,但得到了同樣的錯誤,沒有任何額外的信息,關於它的原因。這裏是:

[SQL] 

CREATE TABLE `customer_form_attribute` (
    `form_code` char(32) NOT NULL, 
    `attribute_id` smallint UNSIGNED NOT NULL, 
    PRIMARY KEY(`form_code`, `attribute_id`), 
    KEY `IDX_CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE` (`attribute_id`), 
    CONSTRAINT `FK_CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `{$installer->getTable('eav_attribute')}` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE 
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer attributes/forms relations'; 
[Err] 1005 - Can't create table './mysite_magento/customer_form_attribute.frm' (errno: 150) 

回答

1

檢查你的mysql錯誤日誌 - 它會有更多的信息。你可能有一個重複的密鑰,在這種情況下,日誌會告訴你哪個表有問題。運行查詢以查找任何重複的密鑰並進行更正。

我建議在升級數據庫之前運行database repair tool。它將識別和糾正大多數數據庫完整性問題。