mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-12-07 00:05:12 +01:00
RPM-GPG-KEY-mysql-2023 (B7B3B788A8D3785C) expired on 2025-10-22, so apt rejects repo.mysql.com with EXPKEYSIG and `update` never upgrades MySQL. Oracle re-issued the same key as RPM-GPG-KEY-mysql-2025 (valid until 2027-10-23). - install: add the repository with setup_deb822_repo and the 2025 key instead of a hand-rolled keyring and sources file - update: move installs still on /usr/share/keyrings/mysql.gpg to the same setup, keeping their release track Co-authored-by: root <root@paperclip.pilz.dev> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
61 lines
1.8 KiB
Bash
61 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 tteck
|
|
# Author: tteck
|
|
# Co-Author: MickLesk (Canbiz)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://www.mysql.com/products/community | https://www.phpmyadmin.net
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
RELEASE_REPO="mysql-8.0"
|
|
RELEASE_AUTH="mysql_native_password"
|
|
prompt="${var_mysql_lts:-}"
|
|
[[ -n "$prompt" ]] || read -r -p "${TAB3}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 || true
|
|
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
RELEASE_REPO="mysql-8.4-lts"
|
|
RELEASE_AUTH="caching_sha2_password"
|
|
fi
|
|
|
|
setup_deb822_repo \
|
|
"mysql" \
|
|
"https://repo.mysql.com/RPM-GPG-KEY-mysql-2025" \
|
|
"http://repo.mysql.com/apt/$(get_os_info id)" \
|
|
"$(get_os_info codename)" \
|
|
"${RELEASE_REPO}"
|
|
|
|
msg_info "Installing MySQL"
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
$STD apt install -y \
|
|
mysql-community-client \
|
|
mysql-community-server
|
|
msg_ok "Installed MySQL"
|
|
|
|
msg_info "Configure MySQL Server"
|
|
ADMIN_PASS="$(random_password 13)"
|
|
$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
|
|
msg_ok "MySQL Server configured"
|
|
|
|
prompt="${var_mysql_phpmyadmin:-}"
|
|
[[ -n "$prompt" ]] || read -r -p "${TAB3}Would you like to add PhpMyAdmin? <y/N> " prompt || true
|
|
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/phpmyadmin.sh)"
|
|
fi
|
|
|
|
msg_info "Start Service"
|
|
systemctl enable -q --now mysql
|
|
msg_ok "Service started"
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|