[Archive] [Release]MySQL On/Off DOS bat
[Archive] [Release]MySQL On/Off DOS bat
Archived author: Roarl • Posted: 2016-01-04T15:30:25+00:00
Original source
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. ![]()
Archived author: Deleted User • Posted: 2016-01-05T00:24:49+00:00
Original source
Just to note, on Linux this is usually...
service mysql stop //To stop MySQL
service mysql start //To start MySQL
service mysql restart //To restart MySQL