Last active
February 16, 2021 20:02
-
-
Save ffund/19f0bfbb9d5c6bc86a9156c0a3c63577 to your computer and use it in GitHub Desktop.
MySQL unattended install
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
sudo apt-get update | |
ROOT_SQL_PASS=root | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $ROOT_SQL_PASS" | |
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $ROOT_SQL_PASS" | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server | |
IP=$(/sbin/ip -o -4 addr list eth1 | awk '{print $4}' | cut -d/ -f1) | |
sudo sed -i "s/127.0.0.1/$IP/g" /etc/mysql/mysql.conf.d/mysqld.cnf | |
sudo service mysql restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment