11

I am running a magento 2.4 project but current not in position to update mysql version. any way to skip that error ?

Magento 2 error Current version of RDBMS is not supported. Used Version: 10.1.37-MariaDB. Supported versions: MySQL-8, MySQL-5.7, MariaDB-(10.2-10.4)

Soniya Garg
  • 155
  • 1
  • 2
  • 7

4 Answers4

29

An alternative solution if you are in a bind.

Edit file app/etc/di.xml

You can specify acceptable MariaDB versions here - currently 10.2-10.4

Example to allow MariaDB 10.5

<item name="MariaDB-(10.2-10.5)" xsi:type="string">^10\.[2-5]\.</item>
elfling
  • 645
  • 5
  • 10
  • Worked perfectly for me. Any idea if there's issues with runnig MariaDB 10.5? – David Stone Jan 24 '22 at 08:00
  • @DavidStone Seems fine on all servers for the last year – elfling Jan 25 '22 at 14:20
  • While this file is versionned by default, it might be overwritten if you use deployment tools (such as capistrano) when running the `composer install` step : `magento2-base` will copy its own di.xml file into `app/etc/di.xml`. In this case, you should use a patch/hotfix file to change the di.xml file. – Cladiuss Aug 08 '22 at 18:34
  • Interesting, I've not had it overwrite on an installation unless magento2-base is reinstalled or upgrading. All over composer updates seem to be ok. Then again, this is sort of a last resort get you out a bind, which hopefully won't be necessary soon once they add 10.5 support. (Fingers crossed) – elfling Aug 09 '22 at 13:26
  • I had to allow Maria DB 10.6, it worked. – Black Nov 04 '22 at 11:01
5

Yes you can try to change one file but can be some issues can occur in project while running.

Go to Vendor/Magento/Framework/DB/Adapter/SqlVersionProvider.php

Update function getVersionString and replace line

$sqlVersionOutput = $this->fetchSqlVersion($resource);

to

$sqlVersionOutput = '10.2.37-MariaDB';

This is temporary solution. So you should consider to update mysql version.

Vipin Garg
  • 466
  • 3
  • 15
1

If you are using MariaDB version greater than 10.9, as example 10.11.3 you have to extend the regexp in app/etc/di.xml like following:

<item name="MariaDB-(10.2-10.5)" xsi:type="string">^10\.[2-9]|10|11\.</item>

BTW my Magento is working correctly with MariaDB 10.11.3

0

You could override module to allow MariaDB 10.5 to 10.9 support for development...

composer require reessolutions/db-override:*

(Source: https://github.com/Sental/db-override)

This has worked for me.

Mike
  • 76
  • 1
  • 8