mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-01-25 10:06:18 +00:00
Update mysql-install.sh (#123)
Added the option to install the 8.4 LTS release
This commit is contained in:
parent
10b2ddf3e0
commit
7a3adeb142
@ -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)? <y/N> " 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
|
||||
|
Loading…
Reference in New Issue
Block a user