13

Pretty much the same as this question but I don't want to have a root password (this is just a dev machine).

Here's what I've got:

export DEBIAN_FRONTEND=noninteractive
sudo debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password password PASS'
sudo debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password_again password PASS'
sudo apt-get install -y mariadb-server

This will install MariaDB silently but it will set the root password to "PASS". If I delete that it does a weird partial install because it's still trying to prompt me.

0

2 Answers 2

17
+50

In the link that Dimitar provided, the question itself hints at a solution - if you're putting this in a script, you could add the SET PASSWORD line with an empty password.

export DEBIAN_FRONTEND=noninteractive
sudo debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password password PASS'
sudo debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password_again password PASS'
sudo apt-get install -y mariadb-server
mysql -uroot -pPASS -e "SET PASSWORD = PASSWORD('');"

That said, I recommend that you keep using passwords, even for dev environments. As suggested on a related serverfault question, you could add lines to your my.cnf which contain the password, meaning that you can still simply fire up mysql by typing 'mysql':

[client]
user = root
password = s3kr1t
1
  • 1
    Didn't know you could do that with a cnf file. That works well. Thank you!
    – mpen
    Mar 6, 2014 at 17:20
1

You need root password to achieve non-interactive installation of MariaDB 10.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.