Windows installs multiple MySQL

Source: Internet
Author: User

Install multiple MySQL, in fact, very simple, online information is also a lot, I tidy up, also followed to gather a lively.

1. Download MySQL zip Extract to the specified directory, my side is 3, more similar

D:\mysql1

D:\mysql2

D:\mysql3

2. Modify the configuration file, My.ini, some versions are not, need to create manually, some inside is my-default.ini, change to My.ini can, if there is no Data folder, create a Data folder

The basic content is as follows, some excessive content is temporarily not used:

[Mysqld]basedir=d:\mysql2datadir=d:\mysql23307character-set -server=2#忘记密码时使用的 #skip-grant-tables# Modify authentication Method #default_authentication_plugin =Mysql_native_password[mysql]default-character-set=utf8

Important changes, that is, port and server_id, default if not set port, then 3306, set here: 3306,3307,3308, corresponding server_id respectively

After you have modified it, save it.

3. Initialize MySQL

Run the command prompt as an administrator, enter the bin directory of the MYSQL2, and enter the following command

Mysqld--initialize--console

Here will generate a random password, please keep in mind, if you accidentally forget, delete all data under the new re-initialization, specifically, you can refer to my other blog----mysql8.0 installation need to change the password to allow remote connection.

4. Install MySQL

Mysqld--install MYSQL2

The MYSQL2 here is the service name that is used to differentiate multiple MySQL, if not written, the default is MySQL, install multiple databases, if not write, will cause the service cannot be started.

5. Start MYSQL2

net start MYSQL2

Normal should start successfully. If startup fails, it is important to check whether you have configured environment variables .

If you have configured the environment variables for 3 MySQL, the system will default to the first one, then you need to modify the registry, the way to modify the following:

Ctrl+r, enter Regeidt in the box that appears, enter into the registry interface.

Locate the following directory: Hkey_local_machine–>system–>currentcontrolset–>services
Find the Mysql2,imagepath you just created the default is that you configure the environment variable that database of mysqld, do not need to delete, only need to add the following sentence:

--defaults-file="D: \mysql2\my.ini" mysql2

And then start again. (The last MYSQL2 is the service name you specified when you installed it, if it is not mysql2 please change to your own service name, front is the path)

6. Install multiple MySQL, do not recommend the configuration environment variables, although the command line operation will be more convenient, do not need to go to the bin directory, but only for one valid, others need to go to the corresponding bin directory, most importantly, in addition to configuring the environment variable this mysql, The rest of MySQL needs to modify the registry to start properly.

7. When installing multiple MySQL logins, please specify port, p uppercase for first port, p lowercase for subsequent password

Mysql-uroot-p3307-p

To this, Windows installs multiple MySQL on the finish, you want to install several installs several, is not very simple!

Windows installs multiple MySQL

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.