MySQL Quick Start bat

Source: Internet
Author: User
Tags goto

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.