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. 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. 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:
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; 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:
|
<<: Node uses koa2 to implement a simple JWT authentication method
>>: How to add Tomcat Server configuration to Eclipse
The command pattern is a behavioral design patter...
As shown below: LOCATE(substr,str) Returns the fi...
Table of contents 1. Nodes, trees, and virtual DO...
1. Add the following dependencies in pom.xml <...
The following content introduces the process and ...
Since the team is separating the front-end and ba...
Here is the mysql driver mysql.data.dll Notice: T...
This article uses an example to describe the crea...
history route History mode refers to the mode of ...
In the vertical direction, you can set the alignm...
<br />Question: How to write in HTML to jump...
Each of these 16 sites is worth reading carefully,...
Copy code The code is as follows: <input type=...
This is because the database server is set to aut...
Copy code The code is as follows: <style type=...