Skip to content

Commit 946e5bd

Browse files
committed
backup location for mysql-8.0.31-winx64.zip
in case of rate-limiting on dev.mysql.com
1 parent e223fd9 commit 946e5bd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/actions/setup-windows/action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@ runs:
55
- name: Setup MySQL
66
shell: pwsh
77
run: |
8-
choco install mysql -y --no-progress --params="/port:3306"
8+
try {
9+
# Try installing MySQL from default choco
10+
choco install mysql -y --no-progress --params="/port:3306"
11+
} catch {
12+
Write-Host "Default MySQL installation failed (dev.mysql.com rate-limiting?). Trying backup location..."
13+
$backupUrl = "https://github.com/divinity76/php-src/releases/download/mysql-8.0.31-winx64.zip/mysql-8.0.31-winx64.zip"
14+
$destination = "C:\tools\mysql-8.0.31-winx64.zip"
15+
Invoke-WebRequest -Uri $backupUrl -OutFile $destination
16+
# Extract and install MySQL manually
17+
Expand-Archive -Path $destination -DestinationPath "C:\tools\mysql"
18+
Write-Host "MySQL extracted to C:\tools\mysql"
19+
# Add MySQL to PATH
20+
$env:Path += ";C:\tools\mysql\bin"
21+
}
922
mysql.exe --port=3306 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;"
1023
- name: Setup MSSQL
1124
shell: pwsh

0 commit comments

Comments
 (0)