1 CLS 2 @echo off3 : Set window font Color4 Color 0a5 : Set Window caption6 TITLE MySQL Management program by Thinkvenus7 8 Pager : Checkadmin9 Ten GotoMenu One : Menu A : Menu - CLS - Echo. the Echo=-=-=-=-Please select what you want to do with MySQL-=-=-=-=- - Echo. - Echo.1: Start MySQL - Echo. + Echo.2: Turn off MySQL - Echo. + Echo.3: Restart MySQL A Echo. at Echo.4: Exit - Echo. - Echo. =-=-=-=-Please enter the item number you want to select ↓-=-=-=- - Set/P id= - if"%id%" = = "1"GotoStartup - if"%id%" = = "2"Gotoshutdown in if"%id%" = = "3"Gotoreboot - if"%id%" = = "4"Exit to Pause + - : Start the : Startup * Echo. $ Pager : Checkmysql1Panax Notoginseng Echo. Start MySQL ... - Net Start"MySQL" the Echo.start MySQL successfully! + Pause A GotoMenu the + : Stop - : Shutdown $ Echo. $ Pager : Checkmysql2 - Echo. Close MySQL ... - NetStop "MySQL" the Echo.turn off MySQL success! - Pause Wuyi GotoMenu the - : Restart Wu : Reboot - Echo. About Pager : Checkmysql2 $ Echo. Close MySQL ... - NetStop "MySQL" - Echo.turn off MySQL success! - GotoStartup A GotoMenu + the : Exit - : Goout $ Pause the GotoMenu the the : Check if the MySQL process exists the : Checkmysql - Set/A count=0 in for/F "Tokens=1 delims="%%i in (' Tasklist/nh ^|Find/i "MySQL") Do(Set/a count+=1) the if%count% NEQ 0if"%1" equ "1" ( the Echowarning: MySQL is started About GotoGoout the) the if%count% equ 0if"%1" equ "2" ( the Echowarning: MySQL does not start + GotoGoout -) the Bayi : Check if you are running as an administrator the : Checkadmin the EchoTest am I admin? >%systemroot%\system32\thinkvenus.Test - if not exist%systemroot%\system32\thinkvenus.test ( - EchoWarning: Please run as Administrator! the Pause the Exit the) the del%systemroot%\system32\thinkvenus.test
Startup shutdown with batch implementation under Windows Mysql_dos/bat