Why MySQL and Not MariaDB on Ubuntu 20.04 - Virtualmin

Ok, so I just installed a Virtualmin instance using Ubuntu 20.04 for the first time and noticed that it installs MySQL 8.x instead of MariaDB (which I am accustomed to).

Is there a reason MySQL is installed instead of MariaDB?

Thanks!

As Joe explains here, Virtualmin uses the software that comes with your OS. See Serious issue with centos-8 when MariaDB 10.5 is pre-installed

1 Like

Both MySQL and Mariadb are available in Ubuntu repos. We don’t really have a preference, but the general feeling I had back around 16.04 and 18.04 (which is temporally when mariadb replaced mysql on CentOS/Fedora/RHEL as the “default” MySQL implementation) there seemed to be no such movement on Debian/Ubuntu. Everybody seemed to want to stick with MySQL on those distros.

And, because MySQL was what Virtualmin had used for years prior, it’s what we stuck with (but didn’t have any option on CentOS, as mariadb was the MySQL implementation).

We don’t care (but you probably shouldn’t care much either). But, if everybody using Ubuntu starts telling us “we prefer mariadb”, that’s fine with us. We can switch in Virtualmin 7. Virtualmin doesn’t care (much) and Webmin doesn’t care (much).

You can switch it yourself, but you’ll probably need to make a few minor tweaks, manually, to get things working nicely. The dependencies in virtualmin-lamp-stack metapackage should be satisfied by either mysql or mariadb, as far as I know.

1 Like

Oh, also, let’s be very clear:

When I say, “You can switch yourself” that shouldn’t be a casual decision…you’ll have a little down-time if you’re already in production. You need to plan a bit for it.

And, you should always use your OS-provided packages whenever possible. Don’t go switching to random packages you found on the internet (or the upstream MariaDB project packages). We can’t help if you do that because we have never seen or used those packages. The OS-provided packages will probably mostly just work, with maybe a minor tweak or two to the config files in Webmin/Virtualmin. You’ll also need a dump/restore of your actual database. MySQL and MariaDB have diverged somewhat in database formats…the dump may not even be directly compatible without some tweaks to syntax and commands.

1 Like

Thank you, Joe! That pretty much answers my question. I would not mess with it if it works just fine. Just my little misconception of MariaDB being a lot faster for WordPress sites - probably doesn’t matter much.

It is not “a lot faster” for anything. The two databases are virtually identical from the perspective of most users. Newer versions of both are generally faster and better than older versions of either…software that is actively maintained tends to get better over time. MariaDB may be more actively maintained these days, or at least has more diversity of contributors, but both are fine and neither is neglected. Both are fast enough for most users and most uses.

1 Like

So, I am just testing out the latest versions of Ubuntu and CentOS to see how Virtualmin runs on them. I have run CentOS 7.x/Virtualmin installs with Nginx 1.18 and MariaDB 10.4 and they run very stable even though those are not the versions that came with the OS, however, that’s because I spent a lot of time testing.
I am new to Ubuntu and still don’t run any live/production stuff on it.

Thanks, Joe!

1st, don’t use ubuntu on production anything bc its a pos.
that said,

MySQL and MariaDB are pretty much alike, including they were developed by the same guy, first MySQL, then when it got acquired by (Sun Microsystems/ and then) Oracle he ported the codebase and started MariaDB. Funny fact, My and Maria are his actual daughters names.

Techwise, MariaDB is more feature-rich, adopted new features while MySQL’s development is a bit more stale. Plus, MySQL has two versions, the open-source community server and the proprietary enterprise server. Obviously the top extensions are proprietary and can be installed as server plugins but paid for.

MariaDB has exactly the same code-base (mysql server 5.5) and has the creator of MySQL and MariaDB working to both keep it up to pace feature wise, and that as he stated, aims to maintain full-compatibility with Oracle provided versions.
Also, MySQL doesn’t comply with the full SQL standards for some of the implemented functionality, including foreign key references.
Up until MySQL 5.7, triggers are limited to one per action / timing, meaning that at most one trigger can be defined to be executed after an INSERT operation, and one before INSERT on the same table. No triggers can be defined on views.

Being from the Enterprise Linux world, that ships MariaDB by default (CentOS 7 replaced MySQL with MariaDB, CentOS and RHEL 8 kept MariaDB, obviously), I actually was surprised reading that the debian folks had reverted back to mysql. but hell, they also think APT is a great package manager. And that’s why I don’t use that family of linux.

They didn’t “revert” anything. Debian and Ubuntu have both mysql and mariadb packages in their repos, and have had for a long time.

We chose to stick with mysql in the Virtualmin installer because, at the time, it seemed to continue to be more popular among users on those distributions. There is no “official” database on Debian or Ubuntu, you can install either one. We picked the one we thought people most wanted and what required the least work from users who would be upgrading from earlier versions of Debian or Ubuntu (since MySQL and MariaDB have diverged, a dump/restore may not be sufficient to migrate between them…it may require a conversion step).

And, for completeness, here’s the MariaDB migration guide: https://mariadb.com/kb/en/upgrading-from-mysql-to-mariadb/

And, known incompatibilities: https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/

It’s not usually a huge ordeal to switch, but it’s an issue to be aware of.

Hi Joe, thank you for your reply.

With all due respect, they didn’t “revert” anything? Ok.
When you by default install package A with a distro, on the next version the package B is chosen to install by default, and then it goes back to package A, that is not “reverting” a decision? Well, ok. maybe it’s my english.

I do believe when compatibility starts breaking with mysql, most will go for MariaDB. Also, for example, one of the biggest industry players on this market (cPanel) has long shifted to mariadb, so its safe to assume that currently there is a whole universe of customers and websites derived from this all using MariaDB. Just the user base of cPanel alone is too big to be neglectable and hosting software should have this present.

But indeed as you mention, both packages are available and one can install whatever wants. But definitely if MariaDB to MySQL migrations break, no one will be going back to mysql from MariaDB, unless there was a very good tradeoff to justify it. And from where I sit, I don’t see it.

Where do you get the idea that Debian reverted back to MySQL?

Hi toreskev,
You made a great question. I did get that idea from a previous answer, but reading through them I don’t see it. So I guess I misunderstood that. I’m sorry, my bad - I said it’s my english! lol
So mariadb is the default db (installed by default) across the board, right?

I don’t know about CentOS, but for Debian the default-mysql package installs MariaDB at least :slight_smile:

Same for RHEL/CentOS/Fedora. I really misunderstood something above and got me thinking the default db-package was back to mysql instead of mariadb. My bad, I apologise!

My Vote is for MariaDB in Ubuntu as well

Tony

I think I’d rather everyone was using mariadb, too. It’d simplify things for us, but I don’t think we’ll ever get away from folks installing the upstream MySQL packages from Oracle.

So, i think for Virtualmin 7, coming by the end of the year (hopefully just a few weeks away, but I’m always swamped…just absolutely overwhelmed at all times, we just don’t have enough developers to manage a project of this size and scope and a userbase this large), we’ll switch the default database in Virtualmin installations to mariadb for all distros.

Maybe I should be looking for people who object to that change rather than people who support it. The general community feeling across all distros does now seem to favor mariadb. We just haven’t done a new major version in a couple of years, so our installer isn’t reflecting that yet (we don’t change package selection between minor versions, as it’d be way too disruptive and confusing).

5 Likes

Just for the record Joe, you guys do an awesome job and have really done a fantastic job of your automated install.!

3 Likes

Yeah…Mariadb’s been the standard on Debian for a while now.

Re: cpanel

I think for the most part the only reason mariadb’s the standard on there is because like Plesk, they’re mostly beholden to CentOS, and CentOS switched to Mariadb even before Debian switched to it. If I remember correctly, Debian hummed and hawed about it for a year or two after CentOS switched before they finally switched.