当前位置:网站首页>[mysql] install multiple MySQL versions on one Windows computer

[mysql] install multiple MySQL versions on one Windows computer

2022-06-22 17:12:00 Seven days at night

[MYSQL] a windows Multiple computers are installed mysql- Different versions

install mysql The following points need to be noted :

  1. Port conflicts ;

  2. stay InnoDB There was a problem trying to initialize its tablespace or log file , Please delete from InnoDB: all ibdata Documents and all ib_logfile All files created file . If you have created some InnoDB surface , Also from MySQL Delete... From the database directory .frm The corresponding documents of these tables ,.ibd If you are using multiple tablespaces , Then delete all file . then InnoDB Try it again Create database ( The official website says );

  3. Multiple mysql In the registry ,\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL* Below the path ImagePath Properties of the mysqld Path and my.ini Path .

The above three problems should be paid attention to during installation .

install mysql Steps are as follows :

  1. download mysql Installation free package , Official website address ;

  2. Will download mysql The installation package is decompressed , stay 5.7 Above version , The extracted root directory file does not contain any my.ini The file ; You can copy it from the Internet or other places ; Or create one yourself ;

Provide a pure version my.ini The contents of the document :

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
 When using the pure version above , Remember more than one MYSQL Remember to set different  port  value , for example :3306、3316 etc. .
 If in my.ini Set up in  innodb_data_home_dir  Catalog , Remember to create your own , Otherwise, when the service is started later ,
 The initialization program will not help you to create , Otherwise, an error will be reported .
  1. Execute initialization command (cmd Get into mysql root directory \bin ):
mysqld --initialize-insecure --console # hinder  console  Print the initialization contents on the console 
  1. Delete InnerDB Generated file ; Generally in mysql root directory \data Will generate ib_logfile0、ib_logfile1、ibdata1 file , Just delete it ; If you are in the my.ini Set up in innodb_data_home_dir Catalog ,ibdata1 The file is generated and then set by you innodb_data_home_dir Directory .
  2. Execute the registration service statement (cmd Get into mysql root directory \bin ):
mysqld install mysql* --defaults-file="mysql root directory \my.ini"  #  Register service command 

mysqld -remove mysql*  #  Uninstall service command 
 Will prompt :Service successfully installed.
  1. Make registry address changes :
    Open the registry , Get into \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL* ; find ImagePath attribute ; Right click to modify ; View the numerical data ,mysql Whether the directory is your installation directory , first mysql No problem with the catalog ; Subsequent installations will only think of the first installation mysql Catalog , So it's changed to :mysql root directory \bin\mysqld --defaults-file=mysql root directory \my.ini MySQL* ;
  2. Start the service :
net start mysql* # Service start command 
net stop mysql* # Service stop command 
 If you need to initialize the password , You can enter the initialization command in the console above when logging in ;
 Or in  my.ini  Set up  skip-grant-tables ( Remember to set this property before executing the initialization command ), In this way, the initial password is empty .
原网站

版权声明
本文为[Seven days at night]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221522489363.html