From 7a3adeb142e09ed09a2f8e33ba30c11421a0d1a5 Mon Sep 17 00:00:00 2001 From: davalanche Date: Thu, 7 Nov 2024 12:41:37 -0600 Subject: [PATCH] Update mysql-install.sh (#123) Added the option to install the 8.4 LTS release --- install/mysql-install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install/mysql-install.sh b/install/mysql-install.sh index 6c8ef192..c8d12b88 100644 --- a/install/mysql-install.sh +++ b/install/mysql-install.sh @@ -24,9 +24,17 @@ $STD apt-get install -y \ mc msg_ok "Installed Dependencies" +RELEASE_REPO="mysql-8.0" +RELEASE_AUTH="mysql_native_password" +read -r -p "Would you like to install the MySQL 8.4 LTS release instead of MySQL 8.0 (bug fix track; EOL April-2026)? " prompt +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + RELEASE_REPO="mysql-8.4-lts" + RELEASE_AUTH="caching_sha2_password" +fi + msg_info "Installing MySQL" curl -fsSL https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | gpg --dearmor -o /usr/share/keyrings/mysql.gpg -echo "deb [signed-by=/usr/share/keyrings/mysql.gpg] http://repo.mysql.com/apt/debian $(lsb_release -sc) mysql-8.0" >/etc/apt/sources.list.d/mysql.list +echo "deb [signed-by=/usr/share/keyrings/mysql.gpg] http://repo.mysql.com/apt/debian $(lsb_release -sc) ${RELEASE_REPO}" >/etc/apt/sources.list.d/mysql.list $STD apt-get update export DEBIAN_FRONTEND=noninteractive $STD apt-get install -y \ @@ -36,7 +44,7 @@ msg_ok "Installed MySQL" msg_info "Configure MySQL Server" ADMIN_PASS="$(openssl rand -base64 18 | cut -c1-13)" -$STD mysql -uroot -p"$ADMIN_PASS" -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$ADMIN_PASS'; FLUSH PRIVILEGES;" +$STD mysql -uroot -p"$ADMIN_PASS" -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH $RELEASE_AUTH BY '$ADMIN_PASS'; FLUSH PRIVILEGES;" echo "" >~/mysql.creds echo -e "MySQL user: root" >>~/mysql.creds echo -e "MySQL password: $ADMIN_PASS" >>~/mysql.creds