magento 安装时 Database server does not support the InnoDB storage engine 的解决办法

magento 安装时 Database server does not support the InnoDB storage engine 的解决办法

 打开app\code\core\Mage\Install\Model\Installer\Db\Mysql4.php文件,编辑supportEngine方法,在原方法中的return前添加以下代码:

 

  1.  
    if (!isset($variables['have_innodb'])) {
  2.  
    $engines = $this->_getConnection()->fetchPairs('SHOW ENGINES');
  3.  
    return (isset($engines['InnoDB']) && ($engines['InnoDB'] == 'DEFAULT' || $engines['InnoDB'] == 'YES'));
  4.  
    }

报错的原因是因为Mysql 5.6版本已经已经丢弃了“have_innodb”这个函数.而Magento1.7.0.2以下,都是使用该函数检测Mysql是否激活了InnodB引擎。

 

=================  测试如下 ===================================

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

posted @   也许明天  阅读(80)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
点击右上角即可分享
微信分享提示