Engine23
blogBannerImage
By Engine23

Magento - Fixing Database server does not support the InnoDB storage engine

Magento version 1.7 and up seem to have an issue with MySQL version 5.6 in determining if InnoDB is available. 

To fix this issue, you need to modify an install file ( and yes its in the core! ).  So do not yell at me for editing a core file, its only executed on a new installation! 

The file in question is:

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

We need to modify a function to allow for the install to take place:

 

Find the existing code that we need to change:

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

New code:

public function supportEngine()
    {
        $variables  = $this->_getConnection()
            ->fetchPairs('SHOW VARIABLES');
        if(substr($variables['version'], 0, 3) == '5.6') {
                return true;
        } else {
                return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true;
        }
     }

So, what we did here was do a check if mysql is version 5.6, its proven that innodb is supported, otherwise do your normal check of the mysql variables to see if its there or not.

If your version of mysql is different, you can just change the 5.6 to whatever yours is, providing it does support innodb!

Once that is changed, save your file and try to finish your installation! You should be good to go.