Tuesday, November 13, 2018

How to install Percona Server 5.7 on Debian/Ubuntu without a root password prompt

In the last few months, I had to install Percona Server 5.7 (PS5.7) on Debian a few times.  I was regularly annoyed by apt-get -y install percona-server-server-5.7 prompting me for a password.  But that annoyance did not push me to investigate the subject in detail: it was always a quick manual fix and Googling did not lead to a straightforward solution.  However in the last days, I had to install PS5.7 on many servers, so it was worth finding how to do this.  I am writing this post in the hope that it will help some people...

Running below achieved what I wanted.
# package="percona-server-server-5.7"
# c1="$package percona-server-server-5.7/root-pass password"
# debconf-set-selections <<< "$c1 my_root_password"
# c2="$package percona-server-server-5.7/re-root-pass password"
# debconf-set-selections <<< "$c2 my_root_password"
Once you know what you are looking for, it is easy to get more information, including this:
# debconf-show percona-server-server-5.7
* percona-server-server-5.7/re-root-pass: (password omitted)
* percona-server-server-5.7/root-pass: (password omitted)
  percona-server-server-5.7/remove-data-dir: false
* percona-server-server-5.7/data-dir:
And for reference, here are the links that ended-up pointing me in the right direction and/or that I found afterward:
And one last thing: maybe PS-3390: document the options available for non-interactive installation in Debian should get more attention (opened in 2016 in Launchpad).

Update: adding MySQL in the text to be caught by PlanetMySQL.

No comments:

Post a Comment