Downgrading MariaDB from 10.11.6 to 10.6

OS type and version Debian Linux 12
Webmin version 2.105
Virtualmin version 7.9.0
Related packages Magento 2.4.6-p4

I tried to install Magento 2.4.6-p4 that supports MariaDB 10.6 but the installed version of MariaDB is 10.11.6. I changed the di.xml but now I get this message:
Warning: preg_match(): Compilation failed: range out of order in character
class at offset 25 in public_html/vendor/magento/framework/DB/
Adapter/SqlVersionProvider.php on line 101

I am afraid to face more issues and it may be a good idea to just downgrade MariaDB. How can I do that?

Here is the function on line 101:
preg_match($pattern, $sqlVersionOutput, $match);
if (empty($match)) {
throw new ConnectionException(
“Current version of RDBMS is not supported. Used Version: %s. Supported versions: %s”,
implode(', ', array_keys($this->supportedVersionPatterns))

You have to stop maridba first remove old one.
sudo apt remove mariadb-server

Add reposiitory via command line:

sudo apt-get install apt-transport-https curl
sudo curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc ''
sudo sh -c "echo 'deb jammy main' >>/etc/apt/sources.list"

and install it again

sudo apt install mariadb-server

systemctl start mariadb
systemctl enable mariadb

this url looks good for what you are looking for.

I never like the idea of downgrading anything that is a current version just because some 3rd party code cannot keep up-to-date.

This looks like an error in the code for Magento 2.4.6-p4 (I wonder if they are aware of it?)

Do not do it! Downgrading your database server to accommodate software’s artificial tests is something that should never be done on a production system.

By the way, Magento installation works just fine on Debian 12 with MariaDB 10.11, as we are already patching di.xml file, though it needs to be done right. It’s tricky.

After the Magento installation by Virtualmin is complete, if you check di.xml, you’ll see how we handle it. Here’s an example:

<item name="MariaDB-10.11" xsi:type="string">^10\.11\.</item>

Please avoid recommending extreme solutions; some users might take them seriously – even worse, some users might do it without making any backups first!

1 Like

While I agree one shouldn’t downgrade a database lightly, I also question whether we can actually say with confidence it is an artificial test? The Magento devs surely know more about their database compatibility than we do? It seems dangerous to override their checks to imply compatibility where that isn’t assured. I don’t think we should be messing around in their business…if the test is wrong, report it upstream, don’t patch it in our software.

1 Like

This is optional in the Magento installation script; removing it would make Magento non-installable on many operating systems our users use, eventually leading to (and has actually led to) blaming us.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.