mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
fix empty password for mysql-server (#2400)
This commit is contained in:
committed by
GitHub
parent
2fdc4d38d9
commit
e470bcde79
@@ -4,29 +4,16 @@
|
|||||||
## Desc: Installs MySQL Client
|
## Desc: Installs MySQL Client
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
source $HELPER_SCRIPTS/os.sh
|
|
||||||
|
|
||||||
export ACCEPT_EULA=Y
|
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 setting up root password
|
||||||
MYSQL_ROOT_PASSWORD=root
|
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 password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
|
||||||
echo "mysql-server mysql-server/root_password_again 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
|
# Install MySQL Server
|
||||||
apt-get install -y mysql-server
|
apt-get install -y mysql-server
|
||||||
|
|
||||||
@@ -36,3 +23,5 @@ apt install libmysqlclient-dev -y
|
|||||||
# Disable mysql.service
|
# Disable mysql.service
|
||||||
systemctl is-active --quiet mysql.service && systemctl stop mysql.service
|
systemctl is-active --quiet mysql.service && systemctl stop mysql.service
|
||||||
systemctl disable mysql.service
|
systemctl disable mysql.service
|
||||||
|
|
||||||
|
invoke_tests "Databases" "MySQL"
|
||||||
|
|||||||
@@ -22,9 +22,10 @@ Describe "MySQL" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
It "MySQL Service" {
|
It "MySQL Service" {
|
||||||
"sudo systemctl start mysql" | Should -ReturnZeroExitCode
|
"sudo systemctl start mysql" | Should -ReturnZeroExitCode
|
||||||
|
mysql -s -N -h localhost -uroot -proot -e "select count(*) from mysql.user where user='root' and authentication_string is null;" | Should -BeExactly 0
|
||||||
"sudo mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
"sudo mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
||||||
"sudo mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
"sudo mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
||||||
"sudo systemctl stop mysql" | Should -ReturnZeroExitCode
|
"sudo systemctl stop mysql" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user