I can install MYSQL on Ubuntu without prompts with the code below:
dbpass="mydbpassword"
export DEBIAN_FRONTEND=noninteractive
echo mysql-server-5.1 mysql-server/root_password password $dbpass | debconf-set-selections
echo mysql-server-5.1 mysql-server/root_password_again password $dbpass | debconf-set-selections
apt-get -y install mysql-server
The part with the debconf-set-selections I got somewhere online (could be here can't remember) and it has worked ok for me thus far. I'm not that much of an expert to understand how it works but it does.
However, I want to do the same thing for Percona. I've setup the apt package manager to deal with using apt-get for percona. So now my code is the following:
dbpass="dbpass" && export dbpass
export DEBIAN_FRONTEND=noninteractive
echo percona-server-server-5.5 percona-server-server-5.5/root_password password $dbpass | debconf-set-selections
echo percona-server-server-5.5 percona-server-server-5.5/root_password_again password $dbpass | debconf-set-selections
apt-get -y install percona-server-server-5.5
However, Percona installs but without a password as defined. I know I'm missing something in the debconf bit.
I'd appreciate some guidance here.
Thanks in advance.
I actually found that the answer here install mysql on ubuntu without password prompt that suggested
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y install mysql-server
Worked and left me with a root user with no password, which is what I wanted.
The second part of the debconf-prefix
should not contain the version number:
echo percona-server-server-5.5 percona-server-server/root_password password $dbpass | sudo debconf-set-selections
echo percona-server-server-5.5 percona-server-server/root_password_again password $dbpass | sudo debconf-set-selections
For 5.6:
echo percona-server-server-5.6 percona-server-server/root_password password $dbpass | sudo debconf-set-selections
echo percona-server-server-5.6 percona-server-server/root_password_again password $dbpass | sudo debconf-set-selections
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With