Mysql 5.6. 37 winx 64 Installation Dual mysql Notes

  • 2021-09-05 01:11:05
  • OfStack

Continue to install the latest version of mysql when the 5.0 version of MySQL already exists on the machine.

1. Download the installation-free compressed package in official website.

I downloaded mysql-5. 6.37-winx64. zip. Unzip the zip to a custom directory. For example: D:\ mysql-5. 6.37.

2. Add environment variables.

Right-click my computer- > Attributes- > Advanced System Settings (Advanced)- > Environment variables. Click the New button under System Variables

Input variable name: MYSQL_HOME Input variable value: D:\ mysql-5. 6.37 (custom decompression directory), select path in system variables, click Edit button to add variable value% MYSQL_HOME%\ bin, and between the previous variable value; Separate.

3. Register for windows System Services

Under cmd, enter the bin directory of the mysql custom extraction directory. Enter D: Enter cd D:\ mysql-5. 6.37\ bin

Enter the installation command: mysqld-install service name (without entering a service name, a service named mysql will be created by default) mysqld-install MySQL defaults-file= "D:\ mysql-5. 6.37\ my.ini"

(The system service is created with the parameters in my. ini in the specified path)

Here, the configuration information of mysql in my. ini needs to be written into my. ini [client]


port=3306
default-character-set=utf8
[mysqld] 
#  Set to MYSQL Installation directory of  
basedir=D:\mysql-5.6.37
#  Set to MYSQL Data directory of  
datadir=D:\mysql-5.6.37\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

4. Start mysql

Enter in cmd

net start service name

5. Common operations

sc delete mysql (delete the service named mysql under cmd)

mysqld remove mysql5.6 (cmd is executed under the bin directory of mysql, and the service named mysql5.6 can be deleted)

net stop mysql (shut down the service named mysql)

6. Precautions and error records

The new mysql port must be different from the previous one Error 1053: The service was prompted for success when it was installed, but error 1053 occurred when the service was started later. Solution: Remove the mysql service you just created and reinstall the service using mysqld-install mysql 5.6. Error 1067: Prompt when starting the service. Solution: Check the my. ini file, find that basedir and datadir are written incorrectly, and change to the correct path to solve it.

Summarize


Related articles: