MySQL removes the service and switches directories under CMD

Source: Internet
Author: User

The actual need to remove the registered MySQL, for a moment to forget the order, hereby recorded

Help finding on the Internet

#Path to installation directory. All paths is usually resolved relative to this.
Basedir= "D:\MySQL Server 5.1/"
#Path to the database root
Datadir= "D:\MySQL Server 5.1/data/"

However, because of the no-install, the service is not generated and can only be achieved with simple commands:

Open the Command window to switch to the MySQL bin directory.

1. Registration Service:

D:\MySQL Server 5.1\bin>mysqld--install mysql51

Enter execution, you will be prompted to create a successful, open service can find the MYSQL51 service just created

2. Uninstall the service:

D:\MySQL Server 5.1\bin>mysqld--remove mysql51

Run bat under the bin directory

The contents are as follows

Close the service. bat

net stop Mysql712

Start the service. bat

CD/D%~dp0

"%cd%\mysqld.exe"-install Mysql712

net start Mysql712

Create a statement for a database

Createdb.bat

@echo off
CD C:\Program Files (x86) \ Industrial computer system \mysql-5.5.21-win32\bin
Set Errorlevel=0
Set database=ipc712
Set User=root
Set password=123456
CD%path_bin_mysql%
mysql.exe-u%user%-p%password%%database%<createtabledata.sql
Pause
Echo End Backup
@echo----Thank you for your cooperation!
Exit

MySQL removes the service and switches directories under CMD

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.