The current version of Shopware 6.4 officially supports MySQL and MariaDB. That said, it’s not compatible with a lot of minor and bugfix releases from the last one and a half years. Although the underlying
doctrine/dbal package has been updated to work with current MySQL >= 8.0.20 in July 2020 it hasn’t made its way to the Shopware core yet.
This is actually a problem, because the highest supported version of MySQL (Version 8.0.19) has no package for Ubuntu 20.04 or 21.04. At least my attempts to install it on Ubuntu failed with an
unmet dependencies errors.
So one can either downgrade to MySQL 5.7 or try to install MariaDB instead. After installing MariaDB on Ubuntu, I ended up with a bleeding edge version (v10.5.13), which is, again, unsupported by Shopware.
Instead of fixing or working through these issues on Ubuntu, I decided to spin up a CentOS server, and see if the versions installed with yum, are supported. And in fact they are. Also, the way CentOS can lock a certain package to a specific version is smart and easy. Here’s the procedure of Installing MariaDB on CentOS:
# allow installs of epel packagessudo yum -y install epel-release sudo yum install nano htopyum updateyum upgrade# disable native appstream repos to prevent conflictsdnf module disable mysql mariadb
Now we can tell CentOS that it ought to stick to version 10.3.28 of MAriaDB. Therefor prevent accidental upgrades in the future. Create the following file:
[mariadb]name = MariaDB-10.3.28baseurl=http://yum.mariadb.org/10.3.28/centos8-amd64/gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1
Now we get the packages GPG key, install and enable MariaDB like so:
sudo rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB # get GPG Keysudo yum clean allsudo yum install mariadb-serversudo systemctl enable mariadb.servicesudo systemctl start mariadb.service/usr/bin/mysql_secure_installation
After that, you can connect to your DB Server, create databases, users and grant privileges.