从 Git Bash (MINGW64) 重新启动 Windows 服务

Restart Windows service from Git Bash (MINGW64)

有没有办法在 Git Bash 脚本中重新启动 Windows 服务?

我正在处理一个脚本(加载一个大转储)以在 MySQL 中进行一些临时性能修改,我需要最后一步:

  1. 像这样重新启动 MySQL:service mysql restart --innodb-doublewrite=0
  2. 导入数据
  3. 正常重启MySQL:service mysql restart

Windows bash 脚本应该仍然可以调用 Windows exe 程序。

所以尝试调用 /C/Windows/System32/sc.exesc command)。
这将使您能够 stop/start 服务。