Home > Database > Mysql Tutorial > body text

Graphical tutorial on installing Mysql5.7.17 under win10 system

黄舟
Release: 2017-03-22 14:03:26
Original
1446 people have browsed it

Because I wanted to install Mysql on the company computer, I downloaded the latest version of Mysql-5.7.17 from the official website. In fact, the installation method is also very simple. Here is the editor Share the installation process to the Script Home platform for your reference

Operating system win10 MySQL is the 64-bit zip decompression Community version downloaded from the official website.

Because I wanted to install Mysql on the company computer, I downloaded the latest version of Mysql-5.7.17 from the official website. First, install it through the online tutorial, decompress it, and then create a new Mysql0104 directory on the C drive ( As the installation directory of Mysql), copy the contents of the decompressed Mysql-5.7.17 folder to the installation directory Mysql.

The content of the file is as follows:

Graphical tutorial on installing Mysql5.7.17 under win10 system

Then follow the online guide: run the command line window as an administrator, mysqld -install to install mysql; this step is not theoretically possible Any problem with normal installation. There will be feedback that the installation has been successful (I forgot to take a screenshot at this step)

In order to avoid subsequent unsuccessful installation, set up the configuration file first, right-click on the MyPC computer, select Properties, click to enter and select Advanced System settings Advanced system settings, click to enter and select Environment Variables, select System variables selected in the red box in the figure below, New adds a system variable MYSQL_HOME, the value is the installation path of mysql, on my computer the value is: C:\mysql0104 , then click Path (generally there will be PATH on the computer, if not, create it yourself), then copy and paste the string of values ​​​​;%MYSQL_HOME%\bin, and the environment variables will be configured, as shown in the figure below.

Graphical tutorial on installing Mysql5.7.17 under win10 system

Graphical tutorial on installing Mysql5.7.17 under win10 system

Graphical tutorial on installing Mysql5.7.17 under win10 system

# Next, you need to perform some installation and configuration of mysql. It's not the same as the old version. Because there is no data file under the mysql0104 folder, we need the system to generate it.

So run the command line window as administrator. Use the cd command to switch directories and make sure the directory is under the bin directory (an error may occur under the system directory, but I have not tried it). Enter the command in the bin directory:

mysqld --initialize

Also available online Say input command:

mysqld --initialize -insecure I have tried both methods, both of which generate a data folder with an empty password. (It is also said on the Internet that a string of passwords will be generated through mysql-console and the like, which need to be written down. It feels very complicated, so don’t bother with it. Just follow the instructions above)

I am also at this step There have been several errors. If an error occurs, just delete the data folder. Then run this line of code again.

But if there is a data folder, an error will definitely be reported when running the above initialization command.

Initialization is very important. After executing the initialization command, the following files will be newly generated in the empty data directory:

Graphical tutorial on installing Mysql5.7.17 under win10 system

Some people on the Internet said that they can be copied Put the data files in the old version of mysql into the installation directory, so that there is no need for system generation. However, I have seen many people saying that this method will cause many problems, so it is not recommended to use it. After all, different versions of

UpdateThere should be some differences in the contents of the data folder.

The next step is to start the mysql service, which is net start mysql. Theoretically, it should start successfully, but mine keeps reporting errors. And it was still an unexplained error. I struggled with this step for a long time, and later found out that in fact, this command does not care about the feedback at all, because as long as the database can operate normally, there will be no other problems.

Graphical tutorial on installing Mysql5.7.17 under win10 system

Don’t worry about it at all, let’s see if our mysql is actually installed successfully:

In the command Enter in the line:

mysql -uroot to enter the database (provided that the password has not been modified and is still empty)

Graphical tutorial on installing Mysql5.7.17 under win10 system

Look, the system feedback has actually been After successfully logging into the database, you can then operate through some commands, such as:

show databases; create test; use test; and a series of commands. Remember to add a semicolon to operate, and a semicolon at the end! !

Graphical tutorial on installing Mysql5.7.17 under win10 system

Then you can create tables in the database normally, query, insert, delete, etc., and the mysql environment will be installed.

The above is the detailed content of Graphical tutorial on installing Mysql5.7.17 under win10 system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!