fix empty password for mysql-server (#2400)

This commit is contained in:
Aleksandr Chebotov
2021-01-08 16:02:09 +03:00
committed by GitHub
parent 2fdc4d38d9
commit e470bcde79
2 changed files with 8 additions and 18 deletions

View File

@@ -4,29 +4,16 @@
## Desc: Installs MySQL Client
################################################################################
source $HELPER_SCRIPTS/os.sh
export ACCEPT_EULA=Y
if isUbuntu16 || isUbuntu18 ; then
apt-get install mysql-client -y
fi
if isUbuntu20 ; then
# Install mysql 8 for Ubuntu 20.
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-server select mysql-8.0'
package_version=$(curl https://dev.mysql.com/downloads/repo/apt/ 2> /dev/null | grep "\.deb" | awk -F "[()]" '{print $2}')
wget https://dev.mysql.com/get/$package_version
dpkg -i $package_version
apt update
fi
# Mysql setting up root password
MYSQL_ROOT_PASSWORD=root
echo "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
# Install MySQL Client
apt-get install mysql-client -y
# Install MySQL Server
apt-get install -y mysql-server
@@ -36,3 +23,5 @@ apt install libmysqlclient-dev -y
# Disable mysql.service
systemctl is-active --quiet mysql.service && systemctl stop mysql.service
systemctl disable mysql.service
invoke_tests "Databases" "MySQL"