MySQL 不会从 Windows 上使用任务计划程序启动的脚本中卸载

问题描述 投票:0回答:1

所以我有一个在登录时运行的计划任务,如果 MySQL 服务无法启动,它会自动重新安装 MySQL。它使用以下命令

MySQLInstallerConsole.exe Remove * --silent
先卸载。

它在用户登录时启动,并以 SYSTEM 用户身份运行。

我确信我已经正确设置了所有管理权限,因为当该命令运行时它不再抛出权限错误。但它只是启动命令并在日志中显示以下内容:

=================== Start Initialization ===================
*WARNING*: Deprecated syntax for an action block is being used and will be removed in a future release. Use commas as separators instead of spaces (Example: --install net;8.0.29, j;8.0.28.).
MySQL Installer is running in Commercial mode

Validating internet connection...
Internet connection found
Attempting to update manifest.
Initializing product requirements.
Loading product catalog.
Checking for product packages in the bundle.
Categorizing product catalog.
Finding all installed packages.
Your product catalog was last updated at 14/11/2023 10:03:38
Your product catalog has version number 694.
=================== End Initialization ===================

It definitely does not uninstall MySQL at all.

The thing is when I run this command with an admin user over ssh or just logged in it still uninstalls MySQL as expected. Even when I trigger the command directly in task scheduler it doesn't uninstall. `whoami` from within the command from task scheduler returns `nt authority\system`
mysql windows taskscheduler
1个回答
0
投票

为了再次卸载并安装 MySQL,我必须确保任务计划程序脚本使用与最初安装 MySQL 相同的普通用户运行。

我想我可以尝试第一次用SYSTEM安装它。但不确定这是否可能。

© www.soinside.com 2019 - 2024. All rights reserved.