sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password your_password'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password your_password'
sudo apt-get -y install mysql-server
For specifikke versioner, såsom mysql-server-5.6
, skal du angive versionen på denne måde:
sudo debconf-set-selections <<< 'mysql-server-5.6 mysql-server/root_password password your_password'
sudo debconf-set-selections <<< 'mysql-server-5.6 mysql-server/root_password_again password your_password'
sudo apt-get -y install mysql-server-5.6
For mysql-community-server er nøglerne lidt anderledes:
sudo debconf-set-selections <<< 'mysql-community-server mysql-community-server/root-pass password your_password'
sudo debconf-set-selections <<< 'mysql-community-server mysql-community-server/re-root-pass password your_password'
sudo apt-get -y install mysql-community-server
Erstat your_password med den ønskede root-adgangskode. (det ser ud til, at your_password også kan stå tomt for en tom root-adgangskode.)
Hvis din shell ikke understøtter her-strenge (zsh , ksh93 og bash støtte dem), brug:
echo ... | sudo debconf-set-selections