Created
March 9, 2017 22:03
-
-
Save nmicht/b77707a32869d103d0563d8561e14690 to your computer and use it in GitHub Desktop.
Upgrade MySQL without prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
wget http://dev.mysql.com/get/mysql-apt-config_0.8.2-1_all.deb | |
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-tools select MySQL Server (Currently selected: mysql-5.7)' | |
debconf-set-selections <<< "mysql-apt-config mysql-apt-config/select-preview select mysql-5.7" | |
debconf-set-selections <<< "mysql-apt-config mysql-apt-config/select-server select mysql-5.7" | |
debconf-set-selections <<< "mysql-apt-config mysql-apt-config/select-product select Ok" | |
debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' | |
debconf-set-selections <<< 'mysql-community-server mysql-community-server/root-pass password root' | |
debconf-set-selections <<< 'mysql-community-server mysql-community-server/re-root-pass password root' | |
DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.8.2-1_all.deb | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server | |
sudo mysql_upgrade -u root -p | |
sudo service mysql restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the script