bash - Mysql automated installation stuck -


i have written script install set of packages list of servers. when execute script mysql installation got stuck @ "enter root password" section. there need modify in script ? advice me.

is there way pass mysql root password through script ?

below code used

#!/usr/bin/env bash read -p "enter server name : " servername echo "installing package on $servername" ssh "${servername}" sudo apt-get -y install apache2 mysql-server 

installation got stuck here

even if enter password, wouldn't proceed next step. beginner scripting. let me know modify script.

apt-get front-end dpkg , debconf , running in interactive mode default, -y won't change that.

mysql-server installation requires root password interactively entered during installation.

to automatically install mysql server on debian based linux distro, can enter non-interactive mode , preset mysql root password follows.

in shell want run process, execute:

export debian_frontend="noninteractive" 

then

apt-get install -y debconf-utils debconf-set-selections <<< "mysql-server mysql-server/root_password yournewpassword" debconf-set-selections <<< "mysql-server mysql-server/root_password_again yournewpassword" apt-get install -y mysql-server-5.6 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -