From 643ea392e44a0cd719c2b072e7aea52b92e85dc9 Mon Sep 17 00:00:00 2001 From: Elbakyan Shirak Date: Thu, 16 May 2024 17:10:15 +0400 Subject: [PATCH] Upgrade mysql packages to 8.4.0 (#238) --- .../install-Debian/install-preq.sh | 16 ++++------------ .../install-RedHat/install-preq.sh | 8 ++------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/install/OneClickInstall/install-Debian/install-preq.sh b/install/OneClickInstall/install-Debian/install-preq.sh index a7f516867b..500bc5c6b7 100644 --- a/install/OneClickInstall/install-Debian/install-preq.sh +++ b/install/OneClickInstall/install-Debian/install-preq.sh @@ -61,19 +61,19 @@ if ! dpkg -l | grep -q "mysql-server"; then MYSQL_SERVER_USER=${MYSQL_SERVER_USER:-"root"} MYSQL_SERVER_PASS=${MYSQL_SERVER_PASS:-"$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12)"} - # setup mysql 8.0 package + # setup mysql 8.4 package curl -OL http://repo.mysql.com/${MYSQL_PACKAGE_NAME} echo "mysql-apt-config mysql-apt-config/repo-codename select $DISTRIB_CODENAME" | debconf-set-selections echo "mysql-apt-config mysql-apt-config/repo-distro select $DIST" | debconf-set-selections - echo "mysql-apt-config mysql-apt-config/select-server select mysql-8.0" | debconf-set-selections + echo "mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts" | debconf-set-selections DEBIAN_FRONTEND=noninteractive dpkg -i ${MYSQL_PACKAGE_NAME} rm -f ${MYSQL_PACKAGE_NAME} echo mysql-community-server mysql-community-server/root-pass password ${MYSQL_SERVER_PASS} | debconf-set-selections echo mysql-community-server mysql-community-server/re-root-pass password ${MYSQL_SERVER_PASS} | debconf-set-selections echo mysql-community-server mysql-server/default-auth-override select "Use Strong Password Encryption (RECOMMENDED)" | debconf-set-selections - echo mysql-server-8.0 mysql-server/root_password password ${MYSQL_SERVER_PASS} | debconf-set-selections - echo mysql-server-8.0 mysql-server/root_password_again password ${MYSQL_SERVER_PASS} | debconf-set-selections + echo mysql-server mysql-server/root_password password ${MYSQL_SERVER_PASS} | debconf-set-selections + echo mysql-server mysql-server/root_password_again password ${MYSQL_SERVER_PASS} | debconf-set-selections elif dpkg -l | grep -q "mysql-apt-config" && [ "$(apt-cache policy mysql-apt-config | awk 'NR==2{print $2}')" != "${MYSQL_REPO_VERSION}" ]; then curl -OL http://repo.mysql.com/${MYSQL_PACKAGE_NAME} @@ -81,14 +81,6 @@ elif dpkg -l | grep -q "mysql-apt-config" && [ "$(apt-cache policy mysql-apt-con rm -f ${MYSQL_PACKAGE_NAME} fi -if ! grep -q "mysql-innovation" /etc/apt/sources.list.d/mysql.list; then - echo "deb [signed-by=/usr/share/keyrings/mysql-apt-config.gpg] http://repo.mysql.com/apt/${DIST} ${DISTRIB_CODENAME} mysql-innovation" | sudo tee -a /etc/apt/sources.list.d/mysql.list - - if apt-get -y update 2>&1 | grep -q "^W: .*mysql-innovation"; then - sudo sed -i '/mysql-innovation/d' /etc/apt/sources.list.d/mysql.list - fi -fi - # add redis repo --- temporary fix for complete installation on Ubuntu 24.04. REDIS_DIST_CODENAME change to DISTRIB_CODENAME if [ "$DIST" = "ubuntu" ]; then [[ "$DISTRIB_CODENAME" =~ noble ]] && REDIS_DIST_CODENAME="jammy" || REDIS_DIST_CODENAME="${DISTRIB_CODENAME}" diff --git a/install/OneClickInstall/install-RedHat/install-preq.sh b/install/OneClickInstall/install-RedHat/install-preq.sh index 965c87db17..3074a91f53 100644 --- a/install/OneClickInstall/install-RedHat/install-preq.sh +++ b/install/OneClickInstall/install-RedHat/install-preq.sh @@ -54,12 +54,8 @@ curl -fsSL https://rpm.nodesource.com/setup_${NODE_VERSION}.x | sed '/update -y/ #add mysql repo dnf remove -y @mysql && dnf module -y reset mysql && dnf module -y disable mysql -MYSQL_REPO_VERSION="$(curl https://repo.mysql.com | grep -oP "mysql80-community-release-${MYSQL_DISTR_NAME}${REV}-\K.*" | grep -o '^[^.]*' | sort | tail -n1)" -yum localinstall -y https://repo.mysql.com/mysql80-community-release-${MYSQL_DISTR_NAME}${REV}-${MYSQL_REPO_VERSION}.noarch.rpm || true - -if ! yum repolist enabled | grep -q mysql-innovation-community; then - sudo yum-config-manager --enable mysql-innovation-community -fi +MYSQL_REPO_VERSION="$(curl https://repo.mysql.com | grep -oP "mysql84-community-release-${MYSQL_DISTR_NAME}${REV}-\K.*" | grep -o '^[^.]*' | sort | tail -n1)" +yum localinstall -y https://repo.mysql.com/mysql84-community-release-${MYSQL_DISTR_NAME}${REV}-${MYSQL_REPO_VERSION}.noarch.rpm || true if ! rpm -q mysql-community-server; then MYSQL_FIRST_TIME_INSTALL="true";