Ubunu 20.04 Changing Default MySQL8.0 to MariaDB10.3

OS type and version: Ubuntu 20.04
Webmin version: 1.984
Virtualmin version: Version 6.17 Pro
Related products version: MySQL

hey all…

Quick tip…

If you are freshly installing the latest vm-pro 6.17 and need to change from MySQL8.0 default to MariaDB. You should first, run updates & upgrades, remove MySQL8.0, reboot your server, manually install MariaDB, then finally run the in Virtualmin post installation wizard.

This will save you a few hours of troubleshooting.

Bed time… :sleeping: :sleeping_bed:

If you try to switch MySQL8.0 after the Post-Installation wizard, you somehow get faced with a 4 to 5 year old bug.

1 Like


I believe there’s an easier way. If memory serves me correctly (questionable as of late - lol) you can simply install MariaDB and it’ll detect MySQL and effectively remove and replace it.

I considered the dropin method of upgrading, then I read the official mysql upgrade guide and got paranoid.

Why risk a possible incompatibility problem with a completely new install of MySQL with zero databases? Decided to err on the side of caution and just completely wipe out MySQL before installing MariaDB.

Here’s a nifty one-liner to wipe-out MySQL should anyone be interested:

systemctl stop mysql && apt -y purge mysql-server && apt -y purge mysql-client && apt -y purge mysql-common && apt -y purge mysql-server-core-* && apt -y purge mysql-client-core-* && rm -Rf /etc/mysql /var/lib/mysql /var/log/mysql && apt -y autoremove && apt -y autoclean && reboot

Then, after reboot:

apt install mariadb-server && mysql_secure_installation

And you are golden.

If my 2 cents counts for anything, I definitely would vote for a “LAMP with MariaDB” bundle option in Virtualmin 7.

This is the plan to use MariaDB with Virtualmin 7 for clean installs.

1 Like

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