Home >Database >Mysql Tutorial >Graphical tutorial on installing Mysql5.7.17 under win10 system
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:
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.
mysqld --initialize
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)
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: 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 ofUpdateThere 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.Don’t worry about it at all, let’s see if our mysql is actually installed successfully:
mysql -uroot to enter the database (provided that the password has not been modified and is still empty)
show databases; create test; use test; and a series of commands. Remember to add a semicolon to operate, and a semicolon at the end! !
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!