windows Method of installing two MYSQL databases on one machine

  • 2020-06-03 08:36:27
  • OfStack

Environment:
OS:Windows 2003
DB:MYSQL5.5

1. Normal installation of mysql 1 (omitted from installation steps)

2. Stop the first mysql service in the control panel

3. Transfer C:\Program Files\MySQL to another path. Here is copy to E disk

4. Create the ES22en.ini file for the second mysql

The my. ini file for the first mysql defaults to the following path
C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\my.ini
copy This ini file is stored in E:\MySQL\mysql_base, the path can be defined at will and modified as follows:
[client]
port=3307 # The default port for the first database is 3306 and you need to enable another port
# The TCP/IP Port the MySQL Server will listen on
port=3307
# Path to installation directory. All paths are usually resolved relative to this. www.it165.net
basedir="E:\MySQL\MySQL Server 5.5\" # second database basedir
# Path to the database root
datadir="E:\MySQL\ Server 5.5\data\" # second database datadir

5. Create the startup service

mysqld install MySQL2 --defaults-file="E:\MySQL\mysql_base\ini\my.ini"

6. Modify the registry

HKEY_LOCAL_MACHINE-- > SYSTEM-- > CurrentControlSet-- > Services
Find the MySQL2 you just created and change ImagePath to the following ":
"E:\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="E:\MySQL\mysql_base\ini\my.ini" MySQL2

-- The End --

Related articles: