Install multiple MySQL instances on WIN10

Content reprinted with this blog

Background: My local Win10 has already installed a MySQL instance: the installation path (default) is C:\Program Files (x86)\MySQL;

1 Data preparation

1.1 Copy the folder MySQL, then rename

write picture description here

1.2 Copy data

View the my.in file under C:\Program Files (x86)\MySQL, you can view the port where the MySQL service is started and the storage path of the data

write picture description here
write picture description here

Open C:/ProgramData/MySQL/MySQL Server 5.1, make two copies of MySQL Server 5.1, and rename
write picture description here

2. Modify the port, basedir, datadir in the startup my.ini file

Modify the my.ini file under C:\Program Files (x86)\MySQL\MySQL Server 5.1 - 3307: change the startup port to 3307; change the data storage path to the path corresponding to the previous step: C:\ProgramData\MySQL\MySQL Server 5.1 - 3307\data; root path basedir
write picture description here

The my.ini file under C:\Program Files (x86)\MySQL\MySQL Server 5.1 - 3307 is also modified in the same way: modify the startup port bit 3308; the data storage path is changed to the path corresponding to the previous step: C:\ProgramData \MySQL\MySQL Server 5.1 - 3308\data; root path basedir
write picture description here

3. Set up Mysql as a system service

Enter the MySQL Server 5.1 - 3307 directory and run the command mysqld –install MySQL-l3307 in the bin directory (you can customize the service name)
write picture description here

Same operation for MySQL Server 5.1 - 3308
write picture description here


4. Check the registry:

Run regedit to open the registry and find

HEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/

Find MySQL-3307 and MySQL-3308 to see if the value of ImagePath is the corresponding path,
if the value of ImagePath is

C:\Program Files (x86)\MySQL\MySQL Server 5.1 - 3307\bin\mysqld” MySQL-3307

The configuration is successful.

The value of ImagePath when I looked at my registry was:

“C:\Program Files(x86)\MySQL\MySQL Server 5.1 \bin\mysqld” MySQL-3307;

(It does not match its own installation path); because the parameter value defaults to the path of the first MySQL instance during installation, at this time, the value of ImagePath can be manually modified.


5. Start the service:

5.1. Start by command: net start MySQL-3307

write picture description here

5.2. Or find the service in the task manager and start it manually

write picture description here


6 Problems encountered:

6.1 System error 193 occurred.

C:\Users\asus>net start MySQL-3307
System error 193 occurred.
* Not a valid Win32 application.

Solution: There is an empty file of mysqld in the bin directory, just delete it.
write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324811429&siteId=291194637