How to instal with mariadb

SYSTEM INFORMATION
OS type and version REQUIRED
Virtualmin version REQUIRED

Digitalocean 20.04 ubuntu

sudo apt-get install mariadb-server
sudo systemctl start apparmor.service                               │
sudo update-rc.d apparmor defaults                                  │
wget http://software.virtualmin.com/gpl/scripts/install.sh
sh /root/install.sh -b LEMP -m

with latest virtualmin minimal lemp stack

Warning! An error occurred starting MariaDB :

Failed to start mysql.service: Unit mysql.service not found.

Please, I am begging you, read the docs. It is one page: Downloading and Installing Virtualmin – Virtualmin

I will quote the part I need you to read:

“Do not pre-install or pre-configure any additional packages on your OS. The installer expects a freshly installed, supported, OS, and anything you do differently may cause conflicts or configuration errors. If you will be enabling third-party package repositories, do so after installation of Virtualmin, and only with extreme caution.”

If you must change to different packages, you must do it after installation of Virtualmin.

1 Like

So how to make it after install so that it works?
Opcache and everything that helps wordpress be much faster?

One question at a time, please. Opcache is completely unrelated to MySQL. And, Mariadb is not going to make your apps faster than MySQL.

I should be clear, I strongly recommend you stick with the default packages, if you don’t know what you’re doing. There is no significant difference between MySQL and MariaDB, in terms of performance or much of anything else.

But, if you must (though I don’t think you should):

Install Virtualmin. Don’t run the config check, yet.

Then install MariaDB.

Then run the following, as root:

virtualmin config-system --include MySQL

Then login to Virtualmin and run the setup wizard and config check, as usual, which should allow you to set a root password for the database.

That’s it. Probably. But, if you don’t have a good reason to do it, then don’t.

On new fresh install following order Its still showing mysql or ist that correct?

sudo apt install mariadb-server mariadb-server-10.3 mariadb-client-10.3
root@host:~# virtualmin config-system --include MySQL
[1/1] Configuring MySQL                                                 [  ✔  ]
root@host:~# virtualmin config-system --include Mariadb
Can't locate Virtualmin/Config/Plugin/Mariadb.pm in @INC (you may need to install the Virtualmin::Config::Plugin::Mariadb module) (@INC contains: /usr/share/webmin /etc/perl /usr/local/lib/x86_64-linux-
gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux
-gnu/perl-base) at /usr/share/perl/5.30/Module/Load.pm line 77.
Can't locate Virtualmin/Config/Plugin/Mariadb in @INC (@INC contains: /usr/share/webmin /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5
/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl/5.30/Module/Load.pm line 77.

Now if i removed mariadb then i havent removed mysql but such error
sudo apt purgemariadb-server mariadb-server-10.3 mariadb-client-10.3


Warning! MySQL cannot be enabled, as it is not installed on your system
Should i use ubuntu or debian maybe it works?

That’s not a plugin in config-system. I said MySQL. We treat the two databases almost identically, because they are almost identical. In most places in Virtualmin Mariadb and MySQL are also treated identically, again, because they are almost identical and most users never need to care which one they have except to know what the service is named.

What are you doing? I thought you wanted mariadb? Why are you going backward, you’re making this so complicated.

Well it didnt work on ubuntu 20.04.
I tried to remove to see if it works again removing maria with mysql in wizzard since its not removed.

What do you mean it didn’t work? I see an error about mariadb not being able to start, which is unusual, but the wizard may have been able to correct it…but not once you started purging packages. You may need to figure out why mariadb won’t start.

Obviously if you uninstall MySQL and MariaDB Virtualmin it’s going to complain about MySQL being missing (again, Virtualmin treats them almost identically).

Your instructions didnt work on ubuntu 20.04- i got that error. I never removed mysql since instructions didnt said to remove. Wizzard didnt correct. Its Digitalocean ubuntu 20.04. Ill try now with debian.

The wizard calls both MySQL and MariaDB “MySQL”. That does not indicate it didn’t work.

But i cant get past that error following instructions.

If you want MariaDB, use CentOS 8. It uses MariaDB by default.

Virtualmin 7 will use MariaDB across all supported distros.

When could 7 be ready?

MySQL does not appear to be installed and running on your system, or has not yet been set up properly in Webmin’s MySQL Database module. If your system does not use MySQL, it should be disabled in Virtualmin’s module configuration page.

… your system is not ready for use by Virtualmin.

I didnt remove Mysql but followed instructions.

Interesting- i installed again mariadb, its server and client and now it worked. Theres something it does check once in a while. Maybe bug.

Iteresting
Cant get further still
Warning! MySQL could not be started with the new configuration :

Job for mariadb.service failed because a timeout was exceeded. See “systemctl status mariadb.service” and “journalctl -xe” for details.

. The old configuration has been restored.

As I mentioned, you may need to figure out why mariadb won’t start. I assumed installing mariadb would remove/stop mysql, but maybe it doesn’t. If it doesn’t mysql is squatting on the port (they’re almost identical, and use the same port, by default).

To be clear, I’m not telling you to guess why it won’t start and start randomly doing things. I want you to look in the journal and mysql/mariadb logs to see what’s going on, and take the necessary actions to resolve the problem.

It does.
I had a few minutes to spare to test this (work is slow tonight).
The problem at hand seems to be some apparmor stuff, but as I don’t use Ubuntu (then by default not apparmor either) I don’t know how to easily overcome that one and get mariadb started.

That seems unlikely. What makes you think that?

There were some “apparmor: denied” messages when trying to start mariadb.
I don’t remember the exact wording of the message though, and I’ve already purged the test instance.

I was mostly curious to see if it worked, but since I don’t use Ubuntu I can’t say I was too heavily invested.