Last Updated: February 25, 2016
·
339
· Dingo Egret

Install mysql without password promp

If you're using bash scripts to install mysql-server then you might hit a wall because the installation process triggers a prompt for the root password. Here is how you can avoid that.

echo mysql-server mysql-server/root_password password dingo | sudo debconf-set-selections
echo mysql-server mysql-server/root_password_again password dingo | sudo debconf-set-selections

dingo being the password you want set. Include that snippet into your bash script and then install mysql.