关闭mysql自动更新_关闭win10自动更新和运行MySQL有影响吗?

执行下面语句:

Clear-Host

$WindowsUpdatePath = "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\"

$AutoUpdatePath = "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"

If(Test-Path -Path $WindowsUpdatePath) {

Remove-Item -Path $WindowsUpdatePath -Recurse

}

New-Item $WindowsUpdatePath -Force

New-Item $AutoUpdatePath -Force

Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 1

Get-ScheduledTask -TaskPath "\Microsoft\Windows\WindowsUpdate\" | Disable-ScheduledTask

takeown /F C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /A /R

icacls C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /grant Administrators:F /T

Get-ScheduledTask -TaskPath "\Microsoft\Windows\UpdateOrchestrator\" | Disable-ScheduledTask

Stop-Service wuauserv

Set-Service wuauserv -StartupType Disabled

Write-Output "已经关闭所有的windows更新"

229e7e16b8866945423e9f16a74e196d.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以使用Java编写自动Windows 10上部署MySQL的程序,以下是大致的步骤: 1. 下载MySQL安装程序。您可以在MySQL官网下载最新版本的安装程序:https://dev.mysql.com/downloads/installer/ 2. 使用Java编写程序。您可以使用Java的Runtime类来执行操作系统的命令,例如下载安装程序、运行安装程序等。以下是示例代码: ```java public class MysqlInstaller { public static void main(String[] args) { String mysqlUrl = "https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-8.0.27.0.msi"; String mysqlInstallerExe = "mysql-installer-web-community-8.0.27.0.msi"; String mysqlInstallerPath = "C:\\mysql\\installer\\"; try { // 下载MySQL安装程序 URL url = new URL(mysqlUrl); Path installerPath = Paths.get(mysqlInstallerPath, mysqlInstallerExe); Files.copy(url.openStream(), installerPath, StandardCopyOption.REPLACE_EXISTING); // 运行安装程序 String cmd = "msiexec /i \"" + installerPath.toString() + "\" /quiet /qn /norestart"; Process process = Runtime.getRuntime().exec(cmd); process.waitFor(); System.out.println("MySQL installed successfully."); } catch (IOException | InterruptedException e) { e.printStackTrace(); } } } ``` 3. 运行Java程序。在Windows 10上安装Java运行环境,并运行Java程序即可自动部署MySQL。 需要注意的是,在实际开发过程中,您还需要处理一些异常情况,例如下载安装程序失败、运行安装程序失败等。同时,您也需要考虑如何配置MySQL的参数、如何创建数据库和用户、如何启动和关闭MySQL服务等问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值