Virtualmin 7: Ubuntu 22.04 with MySQL 8


In Ubuntu 20.04 i install teejee2008/ppa repository to have MySQL 8 while installing Virtualmin.

I have a new Ubuntu 22.04 installation and the Release File is missing for Ubuntu 22.04 from teejee2008/ppa.

Do you know which repo to install to have MySQL 8 and not MariaDB ?

The Ubuntu 22.04 repositories have MySQL 8. You do not need to enable any third party modules.

Make sure you do this in the following order:

  1. Install Virtualmin on a freshly installed OS, but don’t run the setup wizard or do config check (don’t even login, just complete the install).
  2. Install MySQL 8, replacing MariaDB. Make sure MariaDB is stopped/gone and MySQL starts after the change. You don’t want Webmin to start setting up MariaDB, you want it to always see MySQL databases.
  3. Login to Webmin and go through the setup wizard, etc. Hopefully, it Just Works. But, it’s possible you’ll need to edit the Module Configuration in the Webmin MySQL module to make it aware of where things are (historically, the config files and var paths were the same across both packages, but it’s possible names and paths have diverged, we haven’t tested MySQL in 22.04).

Also, only switch if you have a good reason to switch. There are no technical reasons to choose MySQL over MariaDB, other than you have an app that specifically uses features added to MySQL since the fork and that haven’t made it across. There are some such features (MySQL has made a number of incompatible changes, seemingly intentionally to make it harder to switch back and forth), but most of the community has embraced MariaDB, so it’s very rare to find something that doesn’t work on MariaDB. And, performance will be a wash. Neither is consistently significantly faster than the other…it’ll depend on the workload and tuning. Though the general consensus in the community is that MariaDB is somewhat faster and lighter most of the time (but, again, I don’t think anyone should consider performance a reason to switch in either direction…just that if you think switching to MySQL 8 will make your app faster than MariaDB, that’s probably wrong).

Joe, thank you very much for your prompt reply. I will keep MariaDB since it is very reliable and fast.
May i ask you one more question? If i upgrade the 20.04 VPS i have, to 22.04, will MySQL be replaced with MariaDB or will i still have MySQL ?

That’s a more complicated question, especially since it sounds like you’ve replaced the system standard MySQL with one from a third party repo.

You’re going to need to do some work in this case, no matter what, and I can’t tell you exactly what that’ll entail as I’ve never used the third party MySQL package you’re using.

If (you need to confirm it) the package you’re using puts MySQL in the usual places, and if (you need to confirm it) you can simply install the Ubuntu standard MySQL over the third party one you have installed and it doesn’t put things into a bad state, then you can probably cross-grade your MySQL version to the Ubuntu standard one.

Since you are already on MySQL, the path of least resistance is to stay on MySQL, but since you have a non-standard MySQL package, you’ll need to be extra careful about the upgrade. It may require a dump/restore, it may require some tweaks to the Webmin MySQL configuration (most likely only if things needing tweaking when you switched).

So, my recommendation for upgrading in place is:

  1. Keep the existing Virtualmin repos as they are, including the virtualmin-focal repo. Our virtualmin-lamp-stack package changed from Virtualmin 6 to Virtualmin 7 to use mariadb instead of mysql. So…it’d be easy to accidentally replace MySQL with MariaDB (which is not safe to do without a dump/restore and maybe some data munging), if you switched to the new Virtualmin 7 repos.
  2. Disable that third party MySQL repo. Dump your databases for safety. Even if you confirm with a trivial test case that you can cross-grade between the third party MySQL package and the Ubuntu one, you may find your real databases do something different that breaks…you need good backups of the databases in a form you can easily work with (in addition to the regular backups I assume you’re keeping).
  3. Upgrade to 22.04.
  4. Make sure MySQL “upgraded” to the one from the Ubuntu repos. If not, force it to. And, make sure it is still working afterware.
  5. Then, confirm Virtualmin and Webmin are still able to work with the database.
  6. Check all the other services. We have not done any test upgrades to 22.04 yet. Not a lot of things have changed that would effect Virtualmin, but there are always minor things.

That’s probably it?

I will try to follow your advice, since i am not an expert on this, i just mostly follow tutorials.
One last question for you, if that ok.
I use ondrej/php repo for php version and ondrej/nginx-mainline for nginx.
Do you believe i should use then for future LEMP installations or should i use some other ?

I believe you should only enable third-party repos if you absolutely must. I recommend using the packages provided by your OS whenever possible. They will be better supported, and supported for longer, than anything from a third-party repo. Even a good repo (the ondrej repos are historically pretty well-maintained, but not for as long as an LTS distro will be, and without the long term security patching expertise of Canonical). for ubuntu 18.04 with mysql

to be fair i find virtualmin 6 far batter than 7 =) i have too many websites that to not need a db update at all… its just too much work

mariadb only… bad move

I migrated all my servers to 22.04 with MariaDB and the only issue I came across was,

ERROR 1273 (HY000) at line 25: Unknown collation: 'utf8mb4_0900_ai_ci'

Which I easily solved doing a search and replace on the database dump file. If you or anyone else having this error while migrating to Ubuntu 22.04, you can find a more detailed post here,

1 Like

That is incorrect. We continue to support MySQL. I have posted several times how to do it. And, we continue to recommend you not switch from Mariadb to MySQL if doing a fresh installation. If you need MySQL in a new installation, I’ve explained how; it’s only a couple of extra steps. It is only complicated if you’re moving from MySQL to Mariadb (and my recommendation there is generally to stay with MySQL, and I have explained how in several threads).

Please don’t post old versions of the install script. They are unmaintained and unlikely to continue to work…and it is very hard for us to support a bunch of different ways of installing. There are many other improvements and simplifications in the Virtualmin 7 installer over the Virtualmin 6 installer. If you just want MySQL, then just install MySQL following the instructions I have provided, don’t throw out several years of development, improvements, and bugfixes.

What are the steps to install MySQL instead of MariaDB in a fresh install. Could you please be kind enough to repeat them, or tell me where thay are ?

It’s in this thread: Virtualmin 7: Ubuntu 22.04 with MySQL 8 - #2 by Joe

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