أوامر لتثبيت برنامج MySQL دون نوافذ أو أسئلة، ثم إزالته، والكشف عنه من أدوات النشر. لا يظهر الأمر إلا إذا كان مؤكدًا: من البيان (manifest) أو من الإعداد الافتراضي الموثّق لتقنية المثبّت.
شرح ذو صلة: أوامر التثبيت الصامت: MSI وNSIS وInno Setup · إزالة برنامج عبر السجل (Registry) أو PowerShell
باستخدام winget
PowerShell
winget install --id Oracle.MySQL -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Oracle.MySQL -e --silentwinget uninstall --id Oracle.MySQL -e --silentحسب المثبّت
64 بت · MSI · جميع المستخدمين · en-US
التثبيت الصامت
msiexec /i mysql-8.4.9-winx64.msi /qn /norestartكتابة ملف سجل
msiexec /i mysql-8.4.9-winx64.msi /qn /norestart /l*v "%TEMP%\mysql-install.log"إلغاء التثبيت
msiexec /x {26CF3009-F5EA-4BB7-930F-3BC7814AAC17} /qn /norestart- رمز منتج MSI
- {26CF3009-F5EA-4BB7-930F-3BC7814AAC17}
- مفتاح إلغاء التثبيت في السجل
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26CF3009-F5EA-4BB7-930F-3BC7814AAC17}
- UpgradeCode
- {0E338B32-2B15-4B6B-8A21-E8412C153D81}
- مجلد التثبيت
- %ProgramFiles%\.\MySQL\MySQL Server 8.4
PowerShell: تنزيل وتحقق وتثبيت
ينزّل الملف الرسمي، ويتحقق من بصمة SHA256، ثم يثبّته تثبيتًا صامتًا.
install-mysql.ps1
$url = 'https://cdn.mysql.com/Downloads/MySQL-8.4/mysql-8.4.9-winx64.msi'
$sha256 = '7C3CAEDE97BB4AF923505A92E0B9C9FAB1E5074A841B632387AF7FB059AFBD1E'
$file = Join-Path $env:TEMP 'mysql-8.4.9-winx64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait