上图是常规操作

接下通过脚本方式启动

  1. 创建文本
  2. 重命名如mysql.bat
  3. 编辑上述文件内容
  4. @echo off
    for /f "skip=3 tokens=4" %%i in ('sc query mysql') do set "zt=%%i" &goto :next
    :next
    if /i "%zt%"=="RUNNING" (
    echo mysql is running, is stoping
    net stop mysql
    ) else (
    echo mysql is stop, is starting
    net start mysql
    )
    exit
    pause
    

    5.报存内容

  5. 双击点击试试结果

     

更多推荐

通过.bat快速启动和关闭mysql服务