G
G
globalmac2016-05-05 00:41:09
MySQL
globalmac, 2016-05-05 00:41:09

How to silently install MySQL without password confirmation in Ubuntu 14.04?

Hello!
I'm struggling with the crazy idea of ​​making an installer script for different VPS in order to quickly deploy my working environment for Ubuntu Server 14.04.
There is a bash script in which various settings like this are registered:

apt-get install nginx -y --force-yes -qq > /dev/null 2>&1

Well, everywhere I use > /dev/null 2>&1 , so to speak, in the console everything was beautiful and nothing more =).
Everything is cool until I come to the step of installing mysql (in my case it is Percona):
apt-get install percona-server-server-5.7
This topic - > /dev/null 2>&1 does not work anymore, because a dialog appears there with entering and confirming the root password. It is precisely this dialog that I cannot bypass and I cannot do a "background" or "hidden" installation of MySQL, I need to specify the password manually.
Friends, maybe someone has already encountered such a hardcore and somehow solved a similar issue with bypassing such a perverted moment?
UPD: The solution is a crutch (if we want to upgrade to Percona 5.7), but from 5.5 the flight is normal:
MYSQL_ROOT_PASSWORD=supersecretpass
echo "percona-server-server-5.5 percona-server-server/root_password_again password $MYSQL_ROOT_PASSWORD" | debconf-set-selections > /dev/null 2>&1
echo "percona-server-server-5.5 percona-server-server/root_password password $MYSQL_ROOT_PASSWORD" | debconf-set-selections > /dev/null 2>&1

apt-get install percona-server-server-5.5 -y -qq > /dev/null 2>&1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2016-05-05
@globalmac

Of course, we encountered, of course, we decided .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question