Windows install two MYSQL instances

1. Install one first, refer to

  

 

 

2. Copy the directory of the first instance, modify the name and modify the configuration file, mainly modify the port and basedir and datadir

  

 

 

[mysqld] 
sql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES 
# Set 3306 port 
port = 3307 
# Set mysql installation directory 
basedir = D: \ Develop \ MYSQL \ mysql-8.0.12-win # Remember to use double slashes here \\, I will go wrong with single slashes, but some people's tutorials have single slashes. Try it yourself 
# Set the data storage directory of the mysql database 
datadir = D: \ Develop \ MYSQL \ mysql-8.0.12-win \ data # Here same as above 
# Allow the maximum number of connections 
max_connections = 200 
# Allow the number of failed connections. This is to prevent someone from trying to attack the database system from this host 
max_connect_errors = 10 
# The character set used by the 
server is UTF8 by default # character-set-server = utf8 
# The default storage engine that will be used when creating a new table 
default-storage-engine = INNODB 
# Use "mysql_native_password" plugin authentication by default 
default_authentication_plugin = mysql_native_password 
[mysql] 
# Set mysql client default character set default-character-set = utf8mb4  
default-character-set = utf8 
[client]
# Set the default port used by the mysql client to connect to the server 
port = 3306 
default-character-set = utf8

 

3. Create a service   

   Open the cmd command line in the directory D: \ Develop \ MYSQL \ mysql-8.0.12-win \ bin

mysqld install MySQL2 --defaults-file="D:\Develop\MYSQL\mysql-8.0.12-win\my.ini"

 

4. The service panel starts the service

  

 

 

reference:

  https://blog.csdn.net/weixin_41953055/article/details/79820221

Guess you like

Origin www.cnblogs.com/irobotzz/p/12755726.html