Graphic tutorial on how to install and configure mysql 5.7.17 in Windows 10, windows105.7.17

Source: Internet
Author: User

Graphic tutorial on how to install and configure mysql 5.7.17 in Windows 10, windows105.7.17

In this article, I will explain in detail how to install the latest MySQL database version on Windows 10, that is, MySQL 5.7.17 compressed database.
I will not talk about downloading MySQL 5.7.17 compressed database. No one will. Please do it yourself!

Decompress and install

Since the MySQL5.7.17 database we downloaded is a ZIP Archive version, that is, a compressed version, we only need to decompress it. It is no different from the installation version, but it does not need to be installed. We only need to find the downloaded mysql-5.7.17-winx64.zip file, right-click it, and decompress it to the place you want to install. Select disk C if you like disk C, and select a disk if you don't like it. Here, I chose disk D. After all, the system C has too many items to store. It's okay after decompression, isn't it easy? I know the benefits of ZIP Archive!

Configure the default file

In theory, now we can directly install the service, but because it is the default configuration, we will encounter many problems when using it. For example, the Chinese characters in it are all garbled characters, therefore, we recommend that you configure the default file first. How can I configure it? Don't rush, I slowly arrived, in the mysql-5.7.17 (the author I decompress the directory is the mysql-5.7.17 directory under the D disk) directory, create a new my. ini file, copy the following code to save it OK:

# Client section [client] # default-character-set = utf8 [mysql] # set the default character set default-character-set = utf8 # server section [mysqld] # Skip password issues, but this cannot be completely solved. This statement can ignore the logon check # skip-grant-tables # Set port 3306 = 3306 # Set the mysql installation directory basedir = D: \ mysql-5.7.17 # Set the mysql database data storage directory datadir = D: \ mysql-5.7.17 \ data # maximum number of connections allowed max_connections = 200 # the character set used by the server defaults to an 8-bit latin1 character set character-set-server = utf8 # The default storage that will be used when creating a new table engine default-storage-engine = INNODB # SQL mode: 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 mysql-5.7.17 file under the my-default.ini directory .. The INI file is the configuration file in Windows. Save various default data. The installed version is selected by yourself during installation, and then saved by the system. The ZIP Archive is written by yourself, but the effect is the same. What is the meaning of the code syntax in it? Do students check relevant information by themselves? After all, I cannot tell you a sentence or two (in fact, the author is not very clear ), this file is loaded when the software is running.

Install mysql Service

Press win + R and Type cmd to open the cmd window. Switch the directory to the bin directory of the decompressed file. My directory is the one in the graph, take your own directory as the standard. Then enterMysqld-installPress enter to run it. Note that it is mysqld, not mysql. At this time, we will encounter the first problem:

 

The error message "Install/Remove of the Service Denied!" is displayed !. The resolution is to open the cmd.exe program as an administrator.
When we run the cmd.exe program with the administrator ID, and then install the mysql service, it will be okay.

 

Then enter net start mysql to start the service, so we have encountered the second problem. Please refer:

 

The service cannot be started at the first time, and no error is reported. Then I went to the Internet to find a solution! Find it and find it. It turns out that the version I installed is too new and there is no data folder in the decompressed folder. This folder is very important! Some important data is stored! In addition, you cannot manually create one by yourself (in fact, I did it in the first place ). Then someone said that mysql files can only use commandsMysqld-initialize-insecure-user = rootCreate this folder. I will try it. You can try it!

Open MySQL

Let's switch the directory to D: \ mysql-5.7.17 \ bin! InputMysql-uroot-pCommand. The system prompts you to enter the password (the default password for the decompressed version is blank). Press enter to log on to mysql as root.

 

At this time, we will change the password. Because the default password of the decompressed version is blank, it is a bit strange. So I will tell you how to change the password below. Similarly, go to the D: \ mysql-5.7.17 \ bin directory and executeMysqladmin-uroot-p password, Prompting you to enter the original password (the original password is blank), just press Enter,

 

Note:

  • RunMysql-uroot-pWhen logging on, make sure that the mysql service is enabled.
  • RunMysqladmin-uroot-p passwordWhen changing the password, make sure that the mysql service is enabled.

Configure the Path environment variable

Although mysql is enabled, it is annoying to enter so many commands to switch directories every time you open mysql? How can this problem be solved? Of course I don't need to talk about it. No, I don't have to worry about it. Let me tell you. Right-click the computer → properties → advanced system settings → environment variables → Path → edit, and put the full Path of the bin directory under the mysql software you decompress into it. I suggest you put your shoes at the beginning, and add a semicolon (;) to the path of the directory to save it. D: \ mysql-5.7.17 \ bin;
Why? What is the principle? Simply put, the Path in the environment variable is the directory Path of the cmd system. How does the system know if the command has been entered? What did the system do? In fact, the system searches for all paths in the current directory and Path of the system environment variable. If the first Path is found, an error is returned. So we do not need to switch the cmd directory every time, or set it, and we do not need to switch the cmd path in the future.
For example, the system is like a bus and follows the established route. The path in the environment variable is the route or the station) get Off (run ).

Now we have configured the Path environment variable. Let's run it now!

 

Win + R key, and then typeMysql-uroot-pCommand, and then enter the previously set password. If the logon succeeds, the latest version of the MySQL database is displayed, that isMySQL5.7.17 compressed versionThe database is successfully installed!

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.