Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento install complains about missing InnoDB when it is available

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).

like image 274
Giles Williams Avatar asked Mar 15 '13 23:03

Giles Williams


3 Answers

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 103
Michael Benjamin Avatar answered Oct 15 '22 07:10

Michael Benjamin


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.

like image 20
Rokko_11 Avatar answered Oct 15 '22 07:10

Rokko_11


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;
    }
like image 5
Luke Avatar answered Oct 15 '22 06:10

Luke