Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InnoDB working, still showing "Database server does not support InnoDB storage engine message"

I'm trying to install Magento on a local server using WAMP. InnoDB is set as the default engine but it still shows me the message:

Database server does not support InnoDB storage engine.

I really don't know what to do. Can someone help?

like image 802
user2517781 Avatar asked Jun 24 '13 20:06

user2517781


2 Answers

Go To Line 59 of the file app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php

Replace:

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

With this:

public function supportEngine()
{
    $variables  = $this->_getConnection()
        ->fetchPairs('SHOW ENGINES');
    return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'NO');
}
like image 140
Dhaval Avatar answered Sep 19 '22 14:09

Dhaval


I have encountered this error in default installation from downloader.

because the downloader relied on have_innodb variable, that is from mysql version 5.6.1. unavailable and official documentation (http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_have_innodb) states to use "SHOW ENGINES" instead, I have modified the downloader file accordingly:

/**
 * Check availabe InnoDB on database.
 *
 * @return Magento_Downloader_Validator
 */
protected function _checkDbInnoDb()
{
    if (!$this->_connection) {
        return $this;
    }

    $result = $this->_connection->query('SHOW ENGINES');
    while($row = $result->fetch()){
        if($row["Engine"] == "InnoDB" && $row["Support"] != "NO"){
            $this->addMessage('Database server supports InnoDB storage engine');
            return $this;
        }
    }
    $this->addError('Database server does not support InnoDB storage engine');
    return $this;
}
like image 27
user2718285 Avatar answered Sep 18 '22 14:09

user2718285