MySQL multi-instance running under Windows

Source: Internet
Author: User

Keywords: MySQL multi-instance run under Windows

Pre-reading precautions:
1, some version of the data directory is not directly placed in the MySQL installation directory, it is possible to: C:\ProgramData\MySQL\MySQL Server 5.1\data (regardless of where the path to specify the correct path)
2. Procedure: Copy the MySQL installation directory and modify Port 2 in My.ini, install directory and data directory----> commands to install the MySQL Windows service---> Modify the Registry----> Window service to start a new instance----> normal use
Main article:
1. Normal installation of Windows version of MySQL, such as installed in the D:\MySQL folder;
2. Follow the normal configuration of MySQL;
3. Copy the backup and install the folder, named "mysql_3307"; Delete files in the data directory other folders, only the test and MySQL folder;
4. Modify the My.ini port under "d:\MySQL_3307" to 3307
Java code
[Client]
port=3307
[Mysqld]
# The TCP/IP Port the MySQL Server would listen on
port=3307

Change the program path to d:/mysql_3307

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

5. Administrator status in cmd command line mode, enter the 2nd mysql_3307 \ Bin folder.
Executes the mysqld install mysql_3307 command. The role is to install a service for MySQL, the service name is mysql_3307,
Note: The mysqld install mysql_3307 command must be an administrator to perform successfully
6. When finished, run regedit in the run, open the Windows Registry Editor,
Open in 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
OK, quit Registry Editor.
7. You can then start the mysql_3307 service normally in service management.

Note: If you want to rename the MySQL service name,
1. Enter Services.msc to close the MySQL service
2.C:\>SC delete mysql "MySQL" for the service name
3. Repeat the 6th, 7 steps above
After deleting the service, go to the registration table and see if the old MySQL node is deleted.

MySQL multi-instance run under Windows (GO)

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.