Magento installation errors with MariaDB

Reading time: 2m

Magento is a mature e-commerce platform that provides powerful integration and is extremely customizable.  The software is designed to run on most LAMP stacks without a problem.  However, a lot of hosts will use MariaDB instead of MySQL due it’s increased performance and reliability.  If you’re reading this post, you may have seen an error that says:

Sorry, but we support MySQL version 5.6.0 or later!

Why this happens in the Magento installer

Magento2’s installer is hardcoded to check for a specific MySQL version, which they graciously let you assign to a variable.  The following function checks to see if the version is later than (at the time of this post) the hardcoded default, which is 5.6.0.

What do I change to fix this?

Simply edit line #93 of setup/src/Magento/Setup/Validator/DbValidator.php and replace:

 $mysqlVersion = $connection->fetchOne('SELECT version()');

with

 $mysqlVersion = '5.6.1';

That’s it! You should now be able to re-attempt an install, and should work fine with both MariaDB 10.0.x and 10.1.x branches.

Comments 1

Leave a Reply

Your email address will not be published. Required fields are marked *