-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds MySQL 8.4 3rd Party Integration test
- Loading branch information
1 parent
36c6184
commit 2717134
Showing
13 changed files
with
797 additions
and
151 deletions.
There are no files selected for viewing
62 changes: 2 additions & 60 deletions
62
integration_test/third_party_apps_test/applications/mysql/centos_rhel/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,2 @@ | ||
set -e | ||
|
||
source /etc/os-release | ||
VERSION_ID=${VERSION_ID%%.*} | ||
|
||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | ||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | ||
sudo yum -y install https://repo.mysql.com/mysql80-community-release-el${VERSION_ID}.rpm | ||
|
||
if [ ${VERSION_ID} == 8 ]; then | ||
sudo yum -y module disable mysql | ||
fi | ||
sudo yum -y install mysql-community-server | ||
|
||
echo "default-authentication-plugin=mysql_native_password" | sudo tee -a /etc/my.cnf | ||
|
||
sudo service mysqld start | ||
|
||
password=$(sudo grep -oP '(?<=temporary password is generated for root@localhost: ).*$' /var/log/mysqld.log) | ||
|
||
cat <<EOF > config-user | ||
[client] | ||
user=root | ||
password='$password' | ||
EOF | ||
|
||
mysql --defaults-extra-file=config-user -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password | ||
|
||
# default socket path is different from originally set default (from debian/ubuntu), so we need to create a symlink | ||
sudo ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock | ||
|
||
sudo mkdir /var/log/mysql | ||
sudo chown mysql:mysql /var/log/mysql | ||
|
||
# Required to allow mysql to accept connections on 3307 | ||
if [ ${ID} == rocky ]; then | ||
sudo yum install -y policycoreutils-python-utils | ||
else | ||
sudo yum install -y policycoreutils-python | ||
fi | ||
sudo semanage port --add --type mysqld_port_t --proto tcp 3307 | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/my.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
sudo service mysqld restart | ||
# Centos/RHEL is not tested | ||
exit 1 |
56 changes: 2 additions & 54 deletions
56
integration_test/third_party_apps_test/applications/mysql/debian_ubuntu/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,2 @@ | ||
set -e | ||
|
||
sudo apt update | ||
sudo apt install -y wget | ||
|
||
wget --no-verbose https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb | ||
sudo dpkg -i mysql-apt-config_0.8.29-1_all.deb | ||
sudo apt update | ||
sudo debconf-set-selections <<< 'mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)' | ||
|
||
source /etc/os-release | ||
|
||
sudo apt install -y mysql-server | ||
|
||
if [[ "${ID}" == debian && "${VERSION_ID}" == 9 ]]; then | ||
sudo apt install -y libmariadbclient18 | ||
elif [[ "${ID}" == ubuntu && "${VERSION_ID}" == 1[68].04 ]]; then | ||
sudo apt install -y libmysqlclient20 | ||
elif [[ "${ID}" == ubuntu ]]; then # 19.10 and later | ||
sudo apt install -y libmysqlclient21 | ||
fi | ||
|
||
sudo service mysql start | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
# Disable apparmor for mysql | ||
if [[ "${ID}" == ubuntu ]]; then | ||
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ | ||
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld | ||
fi | ||
|
||
sudo cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/conf.d/ | ||
|
||
sudo chmod uga+r /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /var/log/mysql/ | ||
|
||
sudo service mysql restart | ||
# Debian/Ubuntu is not tested | ||
exit 1 |
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
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
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
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
60 changes: 60 additions & 0 deletions
60
integration_test/third_party_apps_test/applications/mysql8.0/centos_rhel/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
set -e | ||
|
||
source /etc/os-release | ||
VERSION_ID=${VERSION_ID%%.*} | ||
|
||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | ||
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | ||
sudo yum -y install https://repo.mysql.com/mysql80-community-release-el${VERSION_ID}.rpm | ||
|
||
if [ ${VERSION_ID} == 8 ]; then | ||
sudo yum -y module disable mysql | ||
fi | ||
sudo yum -y install mysql-community-server | ||
|
||
echo "default-authentication-plugin=mysql_native_password" | sudo tee -a /etc/my.cnf | ||
|
||
sudo service mysqld start | ||
|
||
password=$(sudo grep -oP '(?<=temporary password is generated for root@localhost: ).*$' /var/log/mysqld.log) | ||
|
||
cat <<EOF > config-user | ||
[client] | ||
user=root | ||
password='$password' | ||
EOF | ||
|
||
mysql --defaults-extra-file=config-user -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password | ||
|
||
# default socket path is different from originally set default (from debian/ubuntu), so we need to create a symlink | ||
sudo ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock | ||
|
||
sudo mkdir /var/log/mysql | ||
sudo chown mysql:mysql /var/log/mysql | ||
|
||
# Required to allow mysql to accept connections on 3307 | ||
if [ ${ID} == rocky ]; then | ||
sudo yum install -y policycoreutils-python-utils | ||
else | ||
sudo yum install -y policycoreutils-python | ||
fi | ||
sudo semanage port --add --type mysqld_port_t --proto tcp 3307 | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/my.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
sudo service mysqld restart |
54 changes: 54 additions & 0 deletions
54
integration_test/third_party_apps_test/applications/mysql8.0/debian_ubuntu/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
set -e | ||
|
||
sudo apt update | ||
sudo apt install -y wget | ||
|
||
wget --no-verbose https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb | ||
sudo dpkg -i mysql-apt-config_0.8.29-1_all.deb | ||
sudo apt update | ||
sudo debconf-set-selections <<< 'mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)' | ||
|
||
source /etc/os-release | ||
|
||
sudo apt install -y mysql-server | ||
|
||
if [[ "${ID}" == debian && "${VERSION_ID}" == 9 ]]; then | ||
sudo apt install -y libmariadbclient18 | ||
elif [[ "${ID}" == ubuntu && "${VERSION_ID}" == 1[68].04 ]]; then | ||
sudo apt install -y libmysqlclient20 | ||
elif [[ "${ID}" == ubuntu ]]; then # 19.10 and later | ||
sudo apt install -y libmysqlclient21 | ||
fi | ||
|
||
sudo service mysql start | ||
|
||
# set up replication source to validate replica metrics | ||
# set main target (replica) to use binary logging for replication to work | ||
sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf >/dev/null <<EOF | ||
server-id = 1 | ||
log-bin = /var/log/mysql/mysql-bin.log | ||
|
||
[mysqld2] | ||
pid-file = /var/run/mysqld/mysql2.pid | ||
socket = /var/run/mysqld/mysql2.sock | ||
port = 3307 | ||
user = mysql | ||
datadir = /var/lib/mysql2/ | ||
log-error = /var/log/mysql/error2.log | ||
server-id = 2 | ||
log-bin = /var/log/mysql/mysql2-bin.log | ||
EOF | ||
|
||
# Disable apparmor for mysql | ||
if [[ "${ID}" == ubuntu ]]; then | ||
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ | ||
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld | ||
fi | ||
|
||
sudo cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/conf.d/ | ||
|
||
sudo chmod uga+r /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /etc/mysql/conf.d/* | ||
sudo chown mysql:mysql /var/log/mysql/ | ||
|
||
sudo service mysql restart |
Oops, something went wrong.