MySQL Quick Start bat
Using batch processing under Windows to start off MySQL, the main idea is to register MySQL as a service under Windows and recommend it to everyone.
The green version of MySQL is registered as a service under Windows, or the installation version of the MySQL Windows service can be used.
Create a file with a. bat suffix, such as mysql.bat, to open the Edit and enter the following. Run as administrator after entering. (if MySQL is installed or configured successfully)
CLS @echo off: Set window font Color 0a: Set window title title MySQL hypervisor call:checkadmin goto menu: Menuclsecho. echo.=-=-=-=-Select the operation you want to use for MySQL-=-=-=-=-echo.echo.1: start mysqlecho.echo.2: Turn off Mysqlecho. Echo.3: Restart Mysqlecho. Echo.4: Exit echo.echo.=-=-=-=-Please enter the item number you want to select ↓-=-=-=-set/p id=if "%id%" = = "1" goto startupif "%id%" = = "2" goto shutdownif "%id % "= =" 3 "goto rebootif"%id% "=" 4 "Exitpause: Start: Startupecho.call:checkMySQL 1echo. Start the mysql......net start" MySQL " echo. start MySQL success! Pause goto Menu: Stop: Shutdownecho.call:checkMySQL 2echo. Close mysql......net stop "MySQL" echo. Turn off MySQL success! Pause goto Menu: Restart: Rebootecho.call:checkMySQL 2echo. Turn off mysql......net stop "MySQL" echo. Turn off MySQL success! Goto Startupgoto Menu: Exit: Gooutpausegoto menu: Check that the MySQL process exists: checkmysqlset/a count=0for/f "Tokens=1 delims="%%i in ( ' Tasklist/nh ^| find/i "MySQL" ') do (set/a count+=1) if%count% neq 0 if "%1" equ "1" (Echo Warning: MySQL has started goto goout) if%count% equ 0 if "%1" equ "2" (Echo Warning: MySQL does not start goto goout): Check whether it is running as Administrator: Checkadminecho test AMI admin? >%systemroot%\system32\test.sunhaoif not exist%systemroot%\system32\test.sunhao (Echo Warning: Please run as Administrator!) Pause exit) del%systemroot%\system32\test.sunhao
MySQL Quick Start bat