MySQL multi-instance operation in Windows

Source: Internet
Author: User
Keywords for MySQL multi-instance running in Windows: precautions before running MySQL multi-instance in Windows: 1. Some data directories are not directly placed in the mysql installation directory, which may be in: C: programDataMySQLMySQLServer5.1data (no matter where the path is located, specify the correct path) 2. Procedure: Copy MySQL Installation

Keywords for MySQL multi-instance running in Windows: precautions before running MySQL multi-instance in Windows: 1. Some data directories are not directly placed in the mysql installation directory, which may be in: C: \ ProgramData \ MySQL Server 5.1 \ data (no matter where the path is set to the correct path) 2. Procedure: Copy MySQL Installation

MySQL multi-instance running in Windows
Keywords: MySQL multi-instance running in Windows

Notes before reading:
1. Some versions of the data Directory are not directly stored in the mysql installation directory, and may be in: C: \ ProgramData \ MySQL Server 5.1 \ data (no matter where the path is, specify the correct path)
2. Procedure: copy the MySQL installation directory --> modify my. port 2 in ini, installation directory and data directory ----> command to install MySQL windows Service ---> modify registry ----> Start window service of new instance ----> normal use
Body:
1. Install MySQL for Windows normally, for example, in the d: \ MySQL folder;
2. Configure MySQL as usual;
3. Copy the folder installed in the backup file and name it "MySQL_3307". delete other folders in the data directory, with only the test and mysql folders left;
4. Modify port my. ini under "d: \ MySQL_3307" to 3307
Java code
[Client]
Port = 3307
[Mysqld]
# The TCP/IP Port the MySQL Server will listen on
Port = 3307

Change the program path to d:/MySQL_3307.

Java code
[Mysqld]
# The TCP/IP Port the MySQL Server will listen on
Port = 3307
# Path to installation directory. All paths are usually resolved relative to this.
Basedir = "d:/MySQL_3307"
# Path to the database root
Datadir = "d:/MySQL_3307/Data /"

5. In cmd command line mode, enter the 2nd MySQL_3307 \ bin folders.
Run the mysqld install MySQL_3307 command. The role is to install a service for Mysql. The service name is MySQL_3307,
6. After that, Run REGEDIT in the running state and open the WINDOWS Registry Editor,
Open HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ MySQL_3307,
Modify the following ImagePath value: "D: \ MySQL_3307 \ bin \ mysqld" -- defaults-file = "D: \ MySQL_3307 \ my. ini" MySQL_3307
Click OK to exit the Registry Editor.
7. Then, you can start the MySQL_3307 service in service management.

Note: to rename the mysql service name,
1. Go to services. msc to disable the MySQL service.
2. C: \> SC delete MySQL "MySQL" is the service name
3. Repeat steps 6th and 7 above.
After the service is deleted, go to the Registry and check whether the old mysql node is deleted.

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.