Transfer: https://blog.csdn.net/u013490585/article/details/54172960
surroundings:
OS: Windows 2003
DB:MYSQL5.5
1. Installation of a normal MySQL (mounting step is omitted)
2. The first stop mysql service in the Control Panel
3. C: \ Program Files \ directory and all files in the MySQL directory copy to another path, I have here a copy to the E drive
4. Create a second mysql the my.ini file
The first mysql the my.ini file by default in the following path
C: \ Documents and Settings \ All the Users \ the Application the Data \ MySQL \ Server MySQL 5.5 \ my.ini
Copy the ini file stored in E: \ MySQL \ mysql_base, this path can define and modify the following:
[Client]
port default port = 3307 # 3306 is the first database to enable a port here need another
# at the TCP / IP port at the MySQL Server by Will the listen oN
port = 3307
# path to . Installation Directory All Paths are usually resolved relative to the this.
basedir = "E: \ MySQL \ MySQL Server 5.5 \" # second database basedir
# Path to database at The root
datadir = "E: \ MySQL \ MySQL Server 5.5 \ the 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
to find MySQL2 just created, the ImagePath modified as follows ":
" E: \ MySQL \ MySQL Server 5.5 \ bin \ mysqld "--defaults-File =" E: \ MySQL \ mysql_base \ ini \ my.ini " mySQL2
7, Problems and Solutions
MySQL2 start, error 1053 error:
Caused by the following reasons, mysql engine is the same, namely innodb_data_home_dir position configuration, copy the following files to the file inside the configuration of the new MySQL2 and innodb_data_home_dir must be configured in two different directories in mysql, do not configure this option, the default directory is stored in datadir.