Second: ZIP installation

1. Download the mysql5.7.27.zip file from the official website

Download address: dev.mysql.com/downloads/m…

2. Unzip the mysql-5.7.27-winx64.zip file and copy it to your installation directory

For example: C:\Program Files\MySQL

3, Double-click mysql-5.7.27-winx64 to go to the folder

Mysql root directory does not contain the data folder or my.ini file.

Data: This folder is used to store data related to the database. The system will automatically create a data directory when we initialize MySQL later. My. ini: This file is used to store MySQL configuration information. This file needs to be created manually.Copy the code

5, create a new file named my.ini (.ini), open it with Notepad, paste the following code into it, change the path to your installation directory, and save:

[Client]
port = 3306

[mysqld]
Set port 3306
port = 3306
Set mysql installation directoryBasedir = C: \ Program Files \ MySQL \ MySQL - 5.7.27 - winx64Mysql > select * from 'mysql'Datadir = C: \ Program Files \ MySQL \ MySQL - 5.7.27 - winx64 \ data# Maximum number of connections allowed
max_connections=200
The default character set used by the server is the 8-bit latin1 character set
character-set-server=utf8
The default storage engine to use when creating new tables
default-storage-engine=INNODB

[mysql]
Mysql client default character set
default-character-set=utf8
Copy the code

6. Initialize MySQL. Search CMD to find the command prompt, right-click to run as administrator, go to the bin directory:

7. Enter the following command:

Mysqld –initialize –user=mysql –console After the initialization is successful, the system automatically generates the data directory in the root directory of mysql and generates the initialization password

Saf(IK8#JW%t

Mysql > install mysql

Mysqld –install mysql displays Service successfully installed. The installation is successful.

9. Run the following command to start mysql

net start mysql

Run the following command to log in to mysql:

Mysql -uroot -p Enter the initial password we just generated

11. Change the mysql login password. Enter the following command (note the semicolon; Oh)

Set password=password(‘ replace this with your new password ‘); You can use the new password to log in to mysql next time.

12, in order to facilitate the later learning and use, we need to configure mysql environment variables.

For details about how to enter the environment variable configuration page, see Entering the Environment Variable Configuration Page. On the environment variable configuration page, edit Path under system variables and add the bin directory of mysql to save the Settings.

Setx PATH “%PATH%”; setx PATH “%PATH%”; C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin

Mysqld –initialize –user= mysqld –console

The system could not continue executing the code because msvcr120.dll was not found. A reinstallation program may resolve this problem

Solution: download.csdn.net/download/gm… Download the file, unzip it and install it. DLL files such as Msvcr120.dll are automatically repaired.