From fee3fd743f6b8770d1a8bc551f7bcc64c3d39c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 26 Oct 2023 08:33:35 +0800 Subject: [PATCH] =?UTF-8?q?MySQL=E5=AE=89=E8=A3=85=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=818.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setup/mysql/mysqlinstallers/mysql_installer.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/web/actions/default/setup/mysql/mysqlinstallers/mysql_installer.go b/internal/web/actions/default/setup/mysql/mysqlinstallers/mysql_installer.go index b00a0c3b..ec1a2f48 100644 --- a/internal/web/actions/default/setup/mysql/mysqlinstallers/mysql_installer.go +++ b/internal/web/actions/default/setup/mysql/mysqlinstallers/mysql_installer.go @@ -408,7 +408,8 @@ func (this *MySQLInstaller) Download() (path string, err error) { // check latest version this.log("checking mysql latest version ...") - var latestVersion = "8.1.0" // default version + var latestVersion = "8.2.0" // default version + var majorVersion = "8.2" { req, err := http.NewRequest(http.MethodGet, "https://dev.mysql.com/downloads/mysql/", nil) if err != nil { @@ -434,6 +435,10 @@ func (this *MySQLInstaller) Download() (path string, err error) { var matches = reg.FindSubmatch(data) if len(matches) > 0 { latestVersion = string(matches[1]) + var matchPieces = strings.Split(latestVersion, ".") + if len(matchPieces) >= 2 { + majorVersion = strings.Join(matchPieces[:2], ".") + } } } } @@ -441,7 +446,7 @@ func (this *MySQLInstaller) Download() (path string, err error) { // download this.log("start downloading ...") - var downloadURL = "https://cdn.mysql.com/Downloads/MySQL-8.1/mysql-" + latestVersion + "-linux-glibc2.17-x86_64-minimal.tar.xz" + var downloadURL = "https://cdn.mysql.com/Downloads/MySQL-" + majorVersion + "/mysql-" + latestVersion + "-linux-glibc2.17-x86_64-minimal.tar.xz" { this.log("downloading from url '" + downloadURL + "' ...")