Issue: Unsupported MariaDB Version Error When Running php magento setup:upgrade
If you encounter the following error while running the php magento setup:upgrade command:
Current version of RDBMS is not supported. Used Version: 10.6.18-MariaDB-deb10-log. Supported versions: MySQL-8, MySQL-5.7, MariaDB-(10.2-10.4)
This error indicates that the current MariaDB version (10.6.18) is not supported by the Magento setup, as it falls outside the acceptable range (MariaDB 10.2 - 10.4).
Solution:
To allow the use of a greater version of MariaDB (e.g., MariaDB 10.6), you need to modify the version pattern in Magento’s app/etc/di.xml file.
Steps:
-
Open the file
app/etc/di.xml. -
Locate the following section under the
<type name="Magento\Framework\DB\Adapter\SqlVersionProvider">:
<type name="Magento\Framework\DB\Adapter\SqlVersionProvider">
<arguments>
<argument name="supportedVersionPatterns" xsi:type="array">
<item name="MySQL-8" xsi:type="string">^8\.0\.</item>
<item name="MySQL-5.7" xsi:type="string">^5\.7\.</item>
<item name="MariaDB-(10.2-10.4)" xsi:type="string">^10\.[2-4]\.</item>
</argument>
</arguments>
</type>
3. Update the MariaDB-(10.2-10.4) line to support newer MariaDB versions, like so:
Original:
<item name="MariaDB-(10.2-10.4)" xsi:type="string">^10\.[2-4]\.</item>
Change to your version (This change allows versions up to 10.6, as the regex now also accepts any version starting with 10.x and 6.x):
<item name="MariaDB-(10.2-10.4)" xsi:type="string">^10\.[2-4]|6\.</item>
Explanation:
-
The
regexpindi.xmldefines the versions of MySQL and MariaDB that Magento recognizes as supported. -
By modifying the regular expression for MariaDB, you are allowing higher versions like 10.6 to be compatible with Magento's requirements.
After making this change, run the php magento setup:upgrade command again, and it should work without any version errors.