41

During installation, Magento produces the following error:

Database server does not support the InnoDB storage engine.

I've fixed all the dependancies for Magento, and double checked with MySQL on the command line using SHOW ENGINES and definitely have InnoDB available (also the default storage engine).

This isn't an issue about access to MySQL config which others might have seen on their install.

Note: This is running on a Mac Pro (with a simple hosts DNS rewrite for the domain name I am developing for).

random
  • 9,774
  • 10
  • 66
  • 83
Giles Williams
  • 683
  • 1
  • 5
  • 14
  • What version of mysql are you using? – Michael Benjamin Mar 15 '13 at 23:03
  • 5.6.10 - literally downloaded it about 20 mins ago – Giles Williams Mar 15 '13 at 23:04
  • Just to confirm, have just created the following test table: +---------------+--------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +---------------+--------------------------------------------------------------------------------------------------------------+ | mystoragetest | CREATE TABLE `mystoragetest` ( `tester` int(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +---------------+----- – Giles Williams Mar 15 '13 at 23:05

7 Answers7

134

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');
}
Michael Benjamin
  • 2,895
  • 1
  • 16
  • 18
20

Or don't do a core-hack! You should override the Installer-Model softly before Installation:

Paste this in your 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>

And following in 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');
    }
}

And enable the extension. The advantage is, that the old validation is still correct, if the mysql-version is older.

Rokko_11
  • 837
  • 2
  • 10
  • 24
5

ver 1.9.1.0 downloader.php

Putting this up for anyone thats using the downloader.php currently bundled in the 1.9.1.0 installer.

If you're happy that your MySQL Database does support InnoDB (It's the DEFAULT) in later versions. You can safely edit the file to remove the check and all the download to take place.

    /**
     * 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;
    }
Community
  • 1
  • 1
Luke
  • 3,481
  • 6
  • 39
  • 63
0

Bug was fixed in Magento CE 1.8, so just use the lines above for CE \leq 1.7

Rokko_11
  • 837
  • 2
  • 10
  • 24
  • Given it's just the `protected function _checkDbInnoDb()` function that still throws this error in `downloader.php` If you're confident your Database does support InnoDB - You can safely comment out the check. – Luke Jul 26 '17 at 00:22
-1
public function supportEngine()
{
    $variables  = $this->_getConnection()->fetchPairs('SHOW ENGINES');
    return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'NO');
}
Xaver Kapeller
  • 49,491
  • 11
  • 98
  • 86
anthony
  • 1
  • 1
-1

I was having the same issue and the only way it worked was when I changed Line 59 of the file app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php from:

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

With:

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

And I didn't find it anywhere so if you are struggling I guarantee this will solve it.

-2

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['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true; 
*/
    return 1;
}
Magento
  • 109
  • 2
  • 1
    why do you bother to change the `fecthPairs` line if you are returning **true** anyway just after? – OSdave Jun 06 '15 at 09:59
  • This is a bad idea, maybe even dangerous. You're suggesting we pretend InnoDB is always enabled, rather than actually checking. – Doug McLean Feb 04 '16 at 10:15