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:
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).
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.
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:
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.
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).
Upgrade to 22.04.
Make sure MySQL “upgraded” to the one from the Ubuntu repos. If not, force it to. And, make sure it is still working afterware.
Then, confirm Virtualmin and Webmin are still able to work with the database.
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.
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).
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.