@echo off set /p op="输入指令 1开启mysql 2关闭mysql:" if "%op%" == "1" ( start D:\wamp\bin\mysql\mysql5.5.8\bin\mysqld.exe echo mysql启动成功 ) if "%op%" == "2" ( taskkill /f /im mysqld.exe ) pause
可以拓展为启停SQLServer 启停Oracle 节约内存
@echo off set /p op="输入指令 1开启mysql 2关闭mysql:" if "%op%" == "1" ( start D:\wamp\bin\mysql\mysql5.5.8\bin\mysqld.exe echo mysql启动成功 ) if "%op%" == "2" ( taskkill /f /im mysqld.exe ) pause
可以拓展为启停SQLServer 启停Oracle 节约内存