linux - install mysql 5.7 purely from bash script on Ubuntu -


i want bash script installs mysql 5.7 instance without needing manual input.

i following tutorial on digital ocean , says 5.7 have run following commands , put commands prompt (screenshot below).

wget http://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb sudo dpkg -i mysql-apt-config_0.6.0-1_all.deb 

how can automate installation if requires me use prompt? should try simulate keystrokes? or going wrong way?

enter image description here

this answer combination , alteration of bimmy's , khrm's answers.

step 1:

you have set debconf values automatically fill in values prompted installation.

export debian_frontend="noninteractive" sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password rootpw" sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password rootpw"

to values need, run installation normally, tutorial of here

step 2:

update information needed apt adding 5.7 repository , updating `apt-get

sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5072e1f5 cat <<- eof > /etc/apt/sources.list.d/mysql.list deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7 eof sudo apt-get update

step 3:

install mysql. can run mysql_secure_installation ask more prompts. mysql_secure_installation script if want can run parts of script relevant you.

i ran sudo apt-get install -y mysql-server-5.7 on own.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -