The last version of MariaDB I had installed on Ubuntu Server 20.04 was 10.3.32 through their own repositories.
I was using the following set of commands (as root):
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu focal main'
apt-get -y update
debconf-set-selections <<< 'mysql-server mysql-server/root_password password example_pass'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password example_pass'
apt-get -y install mariadb-server
Now I've tried installing the latest for the moment version 10.6.5 on another machine (again from their own repositories and again on Ubuntu Server 20.04) but for some reason setting the password doesn't work anymore.
Besides trying to find something useful on Google, I've also tried a few variations of the debconf lines above but none of them worked.
Those are the things I tried (always after apt-get purge mariadb*
):
debconf-set-selections <<< 'mariadb-server mariadb-server/root_password password example_pass'
debconf-set-selections <<< 'mariadb-server mariadb-server/root_password_again password example_pass'
debconf-set-selections <<< 'mysql-server mariadb-server/root_password password example_pass'
debconf-set-selections <<< 'mysql-server mariadb-server/root_password_again password example_pass'
debconf-set-selections <<< 'mariadb-server mysql-server/root_password password example_pass'
debconf-set-selections <<< 'mariadb-server mysql-server/root_password_again password example_pass'
//EDIT:
Forgot to mention that I need this for a bash script that installs MariaDB to multiple servers, so setting the password manually afterwards is not something I'm looking for.