Fix regex to extract MySQL version correctly (#7774)

This commit is contained in:
CanbiZ 2025-09-21 08:28:07 +02:00 committed by GitHub
parent ac3f969016
commit 9ce9de8e84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1322,7 +1322,7 @@ function setup_mysql() {
CURRENT_OS="$(awk -F= '/^ID=/{print $2}' /etc/os-release)"
if command -v mysql >/dev/null; then
CURRENT_VERSION="$(mysql --version | grep -oP 'Distrib\s+\K[0-9]+\.[0-9]+')"
CURRENT_VERSION="$(mysql --version | grep -oP '[0-9]+\.[0-9]+' | head -n1)"
if [[ "$CURRENT_VERSION" != "$MYSQL_VERSION" ]]; then
$STD msg_info "MySQL $CURRENT_VERSION will be upgraded to $MYSQL_VERSION"
NEED_INSTALL=true