Jump to content

[Release]MySQL On/Off DOS bat

By Roarl
in Miscellaneous

Recommended Posts

Hi there,

Very very very very tiny (tiniest maybe?) release : a small macro (DOS) I'm using to start/stop mysql service on my computer.

This saves me some time as I used to start it manually (I don't have a gargantuan computer, so... I can't afford to leave it running all the time if I wanna play/compile properly). Figured maybe some of you couldn't be fagged to do it (which I would understand) so maybe it'll be useful somehow.

for /F "tokens=3 delims=: " %%H in ('sc query "MySQL56" ^| findstr "        STATE"') do (
  if /I "%%H" NEQ "RUNNING" (
   net start "MySQL56"
) ELSE (
	net stop "MySQL56"
)
 
)

(Don't forget to replace MYSQL56 by whatever version you are using ofc.)

 

Cheers. :)

Link to comment
Share on other sites

×
×
  • Create New...