Score:0

Set Root Password During MariaDB 10.6 Install on Ubuntu Server 20.04

tr flag

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.

Liso avatar
sd flag
Just my two cents, if you want to test thing you can use lxc container.
Roberto Andrade avatar
cn flag
were you able to figure this out? bumping into the same issue trying to upgrade from 10.1/2 to 10.6
Sledge Hammer avatar
tr flag
@RobertoAndrade - Unfortunately not. It seems they've made it by default to have no password for root in 10.4 and it might be impossible to do so during install. I'm still on the 10.3.xx branch and it doesn't look like I'll be able to upgrade any time soon because of this and other changes like the removal of the debian-sys-maint user. Here's more info about the root changes - https://mariadb.com/kb/en/authentication-from-mariadb-104/
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.