2013-03-15 24 views
39

在安裝過程中它,Magento的產生以下錯誤:Magento的安裝提示缺少InnoDB的時候,請

Database server does not support the InnoDB storage engine.

,我已經修復所有的依賴關係爲Magento的,然後雙擊使用MySQL的使用命令行SHOW檢查ENGINES,肯定有InnoDB可用(也是默認的存儲引擎)。

這不是一個關於訪問MySQL配置的問題,其他人在安裝時可能會看到這個問題。

注意:這是在Mac Pro上運行的(對於我正在開發的域名,它具有簡單的主機DNS重寫)。

+0

您使用的是哪個版本的mysql? – 2013-03-15 23:03:10

+0

5.6.10 - 大約20分鐘前從字面上下載 – 2013-03-15 23:04:52

+0

剛剛確認,剛剛創建了以下測試表: + --------------- + ------ ------ -------------------------------------------------- -------------------------------------------------- ---- + |表|創建表| + --------------- + -------------------------------- -------------------------------------------------- ---------------------------- + | mystoragetest | CREATE TABLE'mystoragetest'( 'tester' int(1)NOT NULL DEFAULT'0' )ENGINE = InnoDB DEFAULT CHARSET = latin1 | + --------------- + ----- – 2013-03-15 23:05:09

回答

124

文件app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php

的第59行替換:

public function supportEngine() 
{ 
    $variables = $this->_getConnection() 
     ->fetchPairs('SHOW VARIABLES'); 
    return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true; 
} 

與此:

public function supportEngine() 
{ 
    $variables = $this->_getConnection() 
     ->fetchPairs('SHOW ENGINES'); 
    return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'NO'); 
} 
+12

+1 yep,MySQL 5.6刪除了'have_innodb'變量。 – 2013-03-15 23:13:31

+0

輝煌 - 歡呼! – 2013-03-15 23:33:05

+0

不錯的,花了最後一小時試圖弄清楚這個 – 2013-05-06 19:23:46

20

還是不做核心破解!你應該安裝前輕輕覆蓋安裝,型號:

app/code/local/Company/InstallBugfix/etc/config.xml粘貼此:

<?xml version="1.0"?> 
<config> 
    <modules> 
     <Company_InstallBugfix> 
      <version>0.1.0</version> 
     </Company_InstallBugfix> 
    </modules> 
    <global> 
     <models> 
      <installbugfix> 
       <class>Company_InstallBugfix_Model</class> 
      </installbugfix> 
      <install> 
       <rewrite> 
        <installer_db_mysql4>Company_InstallBugfix_Model_Installer_Db_Mysql4</installer_db_mysql4> 
       </rewrite> 
      </install> 
     </models> 
    </global> 
</config> 

,並按照app/code/local/Company/InstallBugfix/Model/Installer/Db/Mysql4.php

<?php 
class Company_InstallBugfix_Model_Installer_Db_Mysql4 extends Mage_Install_Model_Installer_Db_Mysql4 
{ 
    /** 
    * Check InnoDB support 
    * 
    * @return bool 
    */ 
    public function supportEngine() 
    { 
     $supportsEngine = parent::supportEngine(); 
     if ($supportsEngine) { 
      return true; 
     } 
     $variables = $this 
        ->_getConnection() 
        ->fetchPairs('SHOW ENGINES'); 
     return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'NO'); 
    } 
} 

並啓用擴展。好處是,如果mysql版本較舊,那麼舊的驗證仍然正確。

+0

Re「不要做核心黑客攻擊」〜但是,核心開發團隊應該是負責backporting compat ... – 2015-07-13 01:13:38

0

錯誤是固定在Magento CE 1.8,所以只是使用上面的線CE \當量1.7

+5

它似乎回到了下載,v1.9.1 ... – 2015-07-23 10:40:04

+0

鑑於它只是'保護功能_checkDbInnoDb()'功能,仍然會在'downloader.php'中引發此錯誤如果您'確信你的數據庫不支持InnoDB - 你可以安全地註釋掉支票。 – Luke 2017-07-26 00:22:20

-1
public function supportEngine() 
{ 
    $variables = $this->_getConnection()->fetchPairs('SHOW ENGINES'); 
    return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'NO'); 
} 
-1

行該文件的應用程序/代碼/核心/法師/安裝/型號/安裝/ DB 59 /Mysql4.php

替換:

public function supportEngine() 
{ 
    $variables = $this->_getConnection() 
     ->fetchPairs('SHOW VARIABLES'); 
    return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true; 
}  

與此:

public function supportEngine() 
{ 
/* 
    $variables = $this->_getConnection() 
     ->fetchPairs('SHOW ENGINES'); 
    return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true; 
*/ 
    return 1; 
} 
+1

爲什麼你打擾改變'fecthPairs'行,如果你返回**真** **無論如何之後? – OSdave 2015-06-06 09:59:14

+0

這是一個壞主意,甚至可能是危險的。您建議我們假裝InnoDB始終處於啓用狀態,而不是實際檢查。 – 2016-02-04 10:15:10

-1

我有同樣的問題,只是它的工作方式是,當我改變了文件應用程序/代碼/核心/法師/安裝/型號/安裝/ DB/Mysql4.php從59號線:

public function supportEngine() 
{ 
    $variables = $this->_getConnection() 
     ->fetchPairs('SHOW VARIABLES'); 
    return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true; 
} 

有了:

public function supportEngine() 
    { 
     $variables = $this->_getConnection() 
      ->fetchPairs('SHOW ENGINES'); 
     return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'YES'); 
    } 

而且我也找不到任何地方,所以如果你正在努力,我保證,這將解決這個問題。

2

版本1.9.1.0 downloader.php

把這件事的人使用目前在1.9.1.0安裝程序捆綁了downloader.php那。

如果你很高興你的MySQL數據庫在更高版本中支持InnoDB(這是默認值)。您可以安全地編輯該文件以刪除支票並進行所有下載。

/** 
    * Check availabe InnoDB on database. 
    * 
    * @return Magento_Downloader_Validator 
    */ 
    protected function _checkDbInnoDb() 
    { 
     if (!$this->_connection) { 
      return $this; 
     } 
     $this->addMessage('Database server supports InnoDB storage engine'); 
     return $this; 
    }