Install multiple MySQL database on Windows

Step 1: copy the entire MySQL installation file and a copy placed in the installation directory my.ini file, and then modify the following content. Note that can not be set as the default port of 3306, we are here to 3307 ports.

basedir = C: / Program Files / MySQL / MySQL Server 8.0 # installation directory 
datadir = C: / Program Files / MySQL / MySQL Server 8.0 / data # Also the new data folder 
log_bin # enable binary logging 
server_id = 2 # service instance ID, for distinguishing the service from the main 
port = 3307 # ports, must inconsistencies

Do not forget to create a data folder!

Step 2: administrator open CMD window, the installation path into the bin (hereinafter are based on this operation), then follows.

mysqld --initialize-insecure # initialization data file 
mysqld install MySQL2 --defaults-file = " C: \ Program Files \ MySQL \ MySQL Server 8.0 \ my.ini" # specify the configuration file to install the MySQL service (be sure to double quotes)

Step 3: Start MySQL2 service.

net start MySQL2

Step 4: Verify login.

mysql -u root -p -h localhost -P 3307 # -p password (can be the first not write), - P port

 

  At this point, please indicate the source.

 

Guess you like

Origin www.cnblogs.com/wcwnina/p/11330182.html