Home > Database > Mysql Tutorial > Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

黄舟
Release: 2017-03-28 13:38:54
Original
1436 people have browsed it

This article mainly introduces the graphic tutorial of mysql5.7.17 installation and configuration method under Windows 10 in detail. It has certain reference value. Interested friends can refer to it

In this article, I will explain in detail how to install the latest version of MySQL database, which is the MySQL5.7.17 compressed version database on the Windows 10 platform.
I won’t say more about the download of the compressed version of the MySQL5.7.17 database here. For those who don’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 the ZIP Archive version, that is, the compressed version, so just decompress it, and install the version There is no difference, but there is no need to install it. We only need to find the downloaded mysql-5.7.17-winx64.zip file, then right-click and select, unzip it to where you want to install it. If you like the C drive, choose the C drive. If you don't like it, just choose a drive. , here, the author himself chose the D drive. After all, the system C drive stores too many things. Once you unzip it, it’s OK. Isn’t it very simple? Now you know the benefits of ZIP Archive version!

Configuring the default file

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

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

[mysql]
#设置mysql客户端默认字符集
default-character-set=utf8

# SERVER SECTION
[mysqld]
#跳过密码问题,但是这并不能彻底解决,此语句可以忽略登录检查
#skip-grant-tables
#设置3306端口号
port=3306
#设置mysql的安装目录
basedir=D:\mysql-5.7.17
#设置mysql数据库的数据的存放目录
datadir=D:\mysql-5.7.17\data
#允许最大连接数
max_connections=200
#服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
#创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
#SQL模式为strict模式
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_pISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
Copy after login

The my.ini file will replace the my-default.ini file under the mysql-5.7.17 directory. The .ini file is the configuration file in Windows. Save various default data inside. The installation version allows you to choose it during installation, and then the system saves it for you. The ZIP Archive is written by yourself, but the effect is the same. What does the code syntax inside mean? Please check the relevant information yourself. After all, I can't explain it in a sentence or two (in fact, the author himself is not very clear). This file is loaded when the software is running.

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

Install mysql service

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

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

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

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

Then enter net start mysql to start the service, so we encounter the second problem, please see the picture below:

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

When it was started for the first time, it failed to start, and the service did not report any errors. I will then go online to find a solution! I searched and searched, and finally found it. It turned out that the version I installed was too new, and there was no data folder in the decompressed folder. This folder is very important! All important data is stored! And you can’t create it manually (in fact, that’s what I did from the beginning). Then someone said that this folder can only be created through the command mysqld –initialize-insecure –user=root in the mysql document. I tried it and it worked!

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

Open MySQL

Let’s switch the directory to D:\mysql-5.7.17\bin! Enter the mysql -uroot -p command, and it will prompt you to enter a password (the default password for the decompressed version is empty). Just press Enter and you will successfully log in to mysql as root.

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

At this time we will change the password, because the default password of the decompressed version is empty, which always feels a bit weird, 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, you will be prompted to enter the original password (the original password is empty), just press Enter, such as Picture:

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

Note:

  • Execute mysql -uroot -pThe command is when logging in, please ensure that the mysql service is turned on.

  • When executing the mysqladmin -uroot -p password password command to change the password, please also ensure that the mysql service is turned on.

Configure Path environmentVariables

Although mysql is opened, so many instructions have to be entered every time I open mysql Is it annoying to switch directories? How to do it? Of course, if you know it, there’s no need for me to tell you. If you don’t, don’t worry, I’ll tell you. Right-click this computer→Properties→Advanced System Settings→Environment Variables→Path→Edit, and put the full path to the bin directory under the mysql software you unzipped. I suggest putting the children's shoes at the front, and finally adding an English semicolon (;) after the directory path to save it. Such as 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 the 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. The first one found shall prevail. If it is not found, an error will be reported. So we either need to switch the cmd directory every time, or set it up so that we don’t need to switch the cmd path in the future.
For example: the system is like a bus, it follows a predetermined route. The path in the environment variable is that route or each station. When you reach the station (find the first one), you get off (run) .

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

Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10

win+R key, then type the mysql -uroot -p command, then enter the previously set password, the login is successful , indicating that the latest version of the MySQL database, that is, the MySQL5.7.17 compressed version database was installed successfully!

The above is the detailed content of Graphical tutorial on how to install and configure mysql5.7.17 under Windows 10. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template