MySQL 5.7.17 installation and configuration method graphic tutorial under Windows 10

MySQL 5.7.17 installation and configuration method graphic tutorial under Windows 10

In this article, I will explain in detail how to install the latest version of MySQL database, namely MySQL 5.7.17 compressed version database, on Windows 10 platform.
I won’t go into details about downloading the compressed version of the MySQL 5.7.17 database. If someone doesn’t know how, please do it yourself and have enough food and clothing!

Unzip and install

Since the MySQL5.7.17 database we downloaded is a ZIP Archive version, which is a compressed version, we just need to unzip it. It is no different from the installation version, but it does not need to be installed. We just need to find the downloaded mysql-5.7.17-winx64.zip file, then right-click and select, unzip it to the place you want to install it. If you like to put it in the C drive, choose the C drive, if you don’t like it, just choose a drive yourself. Here, the author chose the D drive. After all, it is not good to store too many things in the system C drive. Just unzip it and it's done. Isn't it simple? Now you know the benefits of the ZIP Archive version!

Configuring default files

In theory, you can install the service directly now, but because it is the default configuration, there will be many problems when we use it, such as the Chinese characters in it are all garbled, so it is recommended that you configure the default file first. How to match it then? Don't worry, I'll come slowly. In the mysql-5.7.17 directory (the directory that the author unzipped is the mysql-5.7.17 directory under drive D), create a new my.ini file, copy the following code and save it:

# CLIENT SECTION
[client]
#default-character-set=utf8

[mysql]
#Set the default character set of MySQL client default-character-set=utf8

#SERVER SECTION
[mysqld]
#Skip the password question, but this does not completely solve the problem. This statement can ignore the login check #skip-grant-tables
#Set port number 3306 port=3306
#Set the installation directory of mysql basedir=D:\mysql-5.7.17
#Set the storage directory of mysql database data datadir=D:\mysql-5.7.17\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 that will be used when creating a new table default-storage-engine=INNODB
#SQL mode is strict mode sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

The my.ini file will replace the my-default.ini file in the mysql-5.7.17 directory. .ini files are configuration files in Windows. Save various default data inside. The installation version allows you to make your own choices during installation, and the system saves them for you. The ZIP Archive is written by yourself, but the effect is the same. You can look up the relevant information yourself to find out what the code syntax means. After all, I can't explain it in a sentence or two (in fact, the author himself is not very clear either). This file is loaded when the software is running.

這里寫圖片描述

Install MySQL service

Press win+R, then type cmd to open the cmd window. Switch the directory to the bin directory of the unzipped file. My directory is the one in the picture, and yours should be based on your own directory. Then enter mysqld -install and press Enter to run it. Note that it is mysqld, not mysql. At this point, we will encounter the first problem, as follows:

這里寫圖片描述

The error message was found to be: Install/Remove of the Service Denied! . The solution is to open the cmd.exe program as an administrator.
When we run the cmd.exe program as an administrator and then install the mysql service, everything will be fine.

這里寫圖片描述

Then enter net start mysql to start the service. Then we encounter the second problem. Please see the figure below:

這里寫圖片描述

When I started it for the first time, it failed to start and the service did not report any errors. I then went online to look for a solution! After searching for a long time, I finally found it. It turned out that the version I installed was too new. There was no data folder in the folder after decompression. This folder is very important! These are some important data! And you can't create it manually (which is what I did at the beginning). Then someone said that in the MySQL document, this folder can only be created through the command mysqld –initialize-insecure –user=root . I tried it and it worked!

這里寫圖片描述

Open MySQL

Let's switch the directory to D:\mysql-5.7.17\bin! Enter the mysql -uroot -p command. When prompted to enter a password (the default password for the decompressed version is empty), press Enter to successfully log in to MySQL as root.

這里寫圖片描述

At this time, we will change the password. Because the default password of the unzipped version is empty, it always feels a bit strange, so I will tell you how to change the password below. Also enter the D:\mysql-5.7.17\bin directory, execute mysqladmin -uroot -p password password , and enter the original password (the original password is empty) when prompted, just press Enter, as shown in the figure:

這里寫圖片描述

Notice:

  • When you execute the mysql -uroot -p command, that is, when you log in, make sure that the mysql service is started.
  • When executing the mysqladmin -uroot -p password command to change the password, make sure that the MySQL service is started.

Configure the Path environment variable

Although MySQL is open, isn't it annoying to have to enter so many commands to switch directories every time you open MySQL? How to do it? Of course I don’t need to tell you if you know how to do it, but don’t worry if you don’t know how to do it, I will tell you. Right-click this computer → Properties → Advanced system settings → Environment variables → Path → Edit, and put the full path of the bin directory under the MySQL software you unzipped into it. I suggest you put it first, and then add a semicolon (;) after the path of the directory and save it. For example, D:\mysql-5.7.17\bin;
Why do you do this? What is the principle? Simply put, the Path in the environment variable is the search directory path of the cmd system. When you enter a command, how does the system know whether this command exists? What did the system do? In fact, the system searches all the paths in the current directory and the system environment variable Path, and takes the first one found as the basis. If it cannot find the first one, an error message will be reported. So we either have to switch the cmd directory every time, or set it up so that we don’t have to switch the cmd path anymore.
To give an analogy: the system is like a bus, following a predetermined route. The path in the environment variable is that route or each station. When you arrive at the station (find the first one), you get off (run).

Now that the Path environment variable is configured, let's run it again!

這里寫圖片描述

Press win+R, then type the mysql -uroot -p command, and then enter the password you set previously. If the login is successful, it means that the latest version of the MySQL database, that is, the MySQL5.7.17 compressed version database, has been installed successfully!

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL 5.7.17 installation and configuration method graphic tutorial
  • mysql5.7.17.msi installation graphic tutorial
  • Tutorial on installing mysql5.7.17 on windows10
  • MySQL 5.7.17 installation and configuration graphic tutorial
  • MySQL 5.7.17 installation and configuration method graphic tutorial (windows)
  • MySQL 5.7.17 installation and configuration method graphic tutorial (CentOS7)
  • MySQL 5.7.17 winx64 installation and configuration method graphic tutorial
  • MySQL 5.7.17 installation and configuration tutorial for Mac
  • MySQL 5.7.17 winx64 installation and configuration graphic tutorial
  • MySQL 5.7.17 installation and configuration method graphic tutorial under win7
  • Mysql5.7.17 winx64.zip decompression version installation and configuration graphic tutorial
  • MySQL 5.7.17 winx64 decompression version installation and configuration method graphic tutorial

<<:  Node uses koa2 to implement a simple JWT authentication method

>>:  How to add Tomcat Server configuration to Eclipse

Blog    

Recommend

JavaScript Design Pattern Command Pattern

The command pattern is a behavioral design patter...

mysql indexof function usage instructions

As shown below: LOCATE(substr,str) Returns the fi...

Vue's Render function

Table of contents 1. Nodes, trees, and virtual DO...

Detailed tutorial on running Tomcat in debug mode in IDEA Maven project

1. Add the following dependencies in pom.xml <...

Mysql stores tree structure through Adjacency List (adjacency list)

The following content introduces the process and ...

Understand the implementation of Nginx location matching in one article

Since the team is separating the front-end and ba...

Brief analysis of the various versions of mysql.data.dll driver

Here is the mysql driver mysql.data.dll Notice: T...

MySQL triggers: creating multiple triggers operation example analysis

This article uses an example to describe the crea...

vue-router history mode server-side configuration process record

history route History mode refers to the mode of ...

HTML table markup tutorial (43): VALIGN attribute of the table header

In the vertical direction, you can set the alignm...

Go to another file after submitting the form

<br />Question: How to write in HTML to jump...

Design reference WordPress website building success case

Each of these 16 sites is worth reading carefully,...

HTML hyperlink style (four different states) setting example

Copy code The code is as follows: <style type=...