MySQL安装程序支持8.2

This commit is contained in:
GoEdgeLab
2023-10-26 08:33:35 +08:00
parent 60f61ee5a7
commit d0c7c71af0

View File

@@ -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 + "' ...")