From 18b18b34ff515e9889da022e8480c48d9ce0833e Mon Sep 17 00:00:00 2001 From: Jiawei Du Date: Wed, 11 Nov 2020 16:24:19 +0800 Subject: [PATCH 1/3] add mysql 8.0 --- mysql-standalone-server-windows/azuredeploy.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-standalone-server-windows/azuredeploy.json b/mysql-standalone-server-windows/azuredeploy.json index 6c3fb55b..4096b083 100644 --- a/mysql-standalone-server-windows/azuredeploy.json +++ b/mysql-standalone-server-windows/azuredeploy.json @@ -60,11 +60,12 @@ }, "mySqlVersion": { "type": "string", - "defaultValue": "5.7", + "defaultValue": "8.0", "allowedValues": [ "5.5", "5.6", - "5.7" + "5.7", + "8.0" ], "metadata": { "description": "MySql Version" @@ -100,6 +101,7 @@ "cseBlobNameScript": "MySql.Setup.CustomScriptExtension.ps1", "mySqlInstallationZipPath": { + "8.0": "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.22-winx64.zip", "5.7": "https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-winx64.zip", "5.6": "https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.35-winx64.zip", "5.5": "https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.54-winx64.zip" From 5a67e2e476174910947933fb7a289deffcc74efc Mon Sep 17 00:00:00 2001 From: Jiawei Du Date: Mon, 16 Nov 2020 15:32:41 +0800 Subject: [PATCH 2/3] install mysql 8.0 --- .../MySql.Setup.CustomScriptExtension.ps1 | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/mysql-standalone-server-windows/MySql.Setup.CustomScriptExtension.ps1 b/mysql-standalone-server-windows/MySql.Setup.CustomScriptExtension.ps1 index 106f19d5..6f7a6cd4 100644 --- a/mysql-standalone-server-windows/MySql.Setup.CustomScriptExtension.ps1 +++ b/mysql-standalone-server-windows/MySql.Setup.CustomScriptExtension.ps1 @@ -173,10 +173,34 @@ function Install-MySqlServer if( -not (Get-Service -Name $serviceName -ErrorAction SilentlyContinue)) { - if($MySqlVersion -eq "5.6" -or $MySqlVersion -eq "5.5" -or $MySqlVersion -eq "5.7") + if($MySqlVersion -eq "5.6" -or $MySqlVersion -eq "5.5" -or $MySqlVersion -eq "5.7" -or $MySqlVersion -eq "8.0") { - if ($MySqlVersion -eq "5.7") - { + if ($MySqlVersion -eq "8.0") { + if (!(Get-WmiObject -Class Win32_Product -Filter "Name LIKE '%Visual C++ 2015%'")) { + # MySQL 8.0 Server requires the Microsoft Visual C++ 2015 Redistributable Package to run on Windows platforms. + # https://dev.mysql.com/doc/refman/8.0/en/windows-installation.html + Write-Verbose -Message "Download Visual C++ 2015 Redistributable" + $vcRuntimes = @( + @{ + "FileName"="vc_redist.x64.exe" + "FileUri"="https://aka.ms/vs/16/release/vc_redist.x64.exe" + } + ) + + foreach ($vcRuntime in $vcRuntimes) { + $vcRuntimeUri = $vcRuntime.FileUri + Download-Package $vcRuntimeUri + $vcRuntimeFile = (Join-Path "$PSScriptRoot" $vcRuntime.FileName) + Write-Verbose -Message "Install Visual C++ 2015 Redistributable, $($vcRuntime.FileName)" + Start-Process -File $vcRuntimeFile -ArgumentList "/install /quiet /passive /norestart /log $env:SystemDrive\Logs\vc_$($vcRuntime.FileName).log" -Wait + } + } else { + Write-Verbose -Verbose -Message "Microsoft Visual C++ 2015 Redistributable is installed" + Get-WmiObject -Class Win32_Product -Filter "Name LIKE '%Visual C++ 2015%'" + } + } + if ($MySqlVersion -eq "5.7" -or $MySqlVersion -eq "8.0") + { # Initialize the data folder if(-not (Test-Path (Join-Path $Destination "data"))) { From fc77b8f06ba4989817afdcedfeea772bcd30530f Mon Sep 17 00:00:00 2001 From: Jiawei Du Date: Mon, 16 Nov 2020 15:45:55 +0800 Subject: [PATCH 3/3] change the mysql installation script --- mysql-standalone-server-windows/azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-standalone-server-windows/azuredeploy.json b/mysql-standalone-server-windows/azuredeploy.json index 4096b083..de4339fa 100644 --- a/mysql-standalone-server-windows/azuredeploy.json +++ b/mysql-standalone-server-windows/azuredeploy.json @@ -97,7 +97,7 @@ "imageOffer": "WindowsServer", "dnsNameForPublicIP": "[tolower(parameters('vmName'))]", "OSDiskName": "[concat('osdisk-', parameters('vmName'))]", - "assetLocation": "https://raw.githubusercontent.com/Azure/AzureStack-QuickStart-Templates/master/mysql-standalone-server-windows/", + "assetLocation": "https://raw.githubusercontent.com/msftcoderdjw/AzureStack-QuickStart-Templates/staging/mysql-standalone-server-windows/", "cseBlobNameScript": "MySql.Setup.CustomScriptExtension.ps1", "mySqlInstallationZipPath": {