How to install two MYSQL Databases on one machine in windows

Source: Internet
Author: User

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 --

Related Article

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.