Magento安装时会抱怨缺lessInnoDB

在安装过程中,Magento会产生以下错误:

数据库服务器不支持InnoDB存储引擎。

我已经修复了Magento的所有依赖关系,并且使用SHOW ENGINES在命令行中使用MySQL进行了双重检查,并且肯定有InnoDB可用(也是默认的存储引擎)。

这不是一个关于访问MySQLconfiguration的问题,其他人可能在安装时看到这个问题。

注意:这是在Mac Pro上运行(对于我正在开发的域名,使用简单的主机DNS重写)。

文件app/code/core/Mage/Install/Model/Installer/Db/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['InnoDB']) && $variables['InnoDB'] != 'NO'); } 

或者不要做核心破解! 在安装之前,您应该轻轻覆盖安装程序模型:

将其粘贴到您的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版本比较老,旧的validation仍然是正确的。

ver 1.9.1.0 downloader.php

把它放在任何使用当前捆绑在1.9.1.0安装程序中的downloader.php的人1.9.1.0

如果你很高兴你的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; } 

Bug在Magento CE 1.8中得到了修复,因此只需使用上面的CE \ leq 1.7

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

文件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['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true; */ return 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'); } 

我没有find它,所以如果你正在努力,我保证这将解决它。