Environment:
OS: Windows 2003
DB: MYSQL5.5
1. Install the first mysql normally (the installation steps are omitted)
2. Stop the first mysql service in the control panel
3. copy all the directories and Files under the C: \ Program Files \ MySQL directory to another path. Here I copy them to the E disk.
4. Create the my. ini file of the second mysql instance
The first mysql my. ini file is in the following path by default
C: \ Documents ents and Settings \ All Users \ Application Data \ MySQL Server 5.5 \ my. ini
Copy the INI file and store it in E: \ MySQL \ mysql_base. You can define this path and modify the following content:
[Client]
Port = 3307 # The default port of the first database is 3306. You need to enable another port here.
# 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 Server 5.5 \" # basedir
# Path to the database root
Datadir = "E: \ MySQL Server 5.5 \ data \" # second database datadir
5. Create a 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 created MySQL2 and change ImagePath to the following ":
"E: \ MySQL Server 5.5 \ bin \ mysqld" -- defaults-file = "E: \ MySQL \ mysql_base \ ini \ my. ini" MySQL2
-- The End --