MySQL 5.7.27 winx64 installation and configuration method


This article shared MySQL 5.7.27 winx64 installation and configuration method for your reference, the specific content is as follows

1. Start withOfficial websiteThe version I downloaded here is mysql-5.7.27-winx64.When you just downloaded it, it was a MySQL compressed package, namely Unzip it to the current directory.


2. Enter the mysql-5.7.27-winx64 directory, create a new TXT file, and rename it to my.ini , which is a configuration file.As shown in the figure:

3. Open my.ini File, and use the following code to configure(paste and copy the code, but pay attention to the location of the file!)

Here we use InnoDB as the database engine, the maximum number of connections is 200, the code is set to utf8, and the line drawing position can be changed to its own storage location. Remember to save the file after pasting the code!

4. Configure environment variables

Find: my computer – properties – advanced environment settings – environment variables – system environment. Create a new system environment variable,
The variable name and value are mysql_ The home storage location is shown in the figure: (here is the file location of my MySQL storage)

Then click path in the system variable, – edit and add;% mysql_ The configuration here is separated by semicolons.

5. Start installing mysql

First open CMD and run it as an administrator
Then switch to the bin directory under the MySQL file, as shown in the figure. You can switch level by level according to the file path.

Start installing MySQL

Next, on the CMD command line above, enter the command mysqld — install, and then enter
If you have installed MySQL before, the system will prompt you that you have installed mysql. At this time, you need to shut down the MySQL server, switch back to Disk C, and then execute the command net stop mysql
Then switch back to the bin directory of MySQL and delete the previously installed MySQL with the command
The delete command is mysqld — remove
After deleting, execute mysqld — install to install

6. Generate the data directory to store the data of MySQL database

The command is: mysqld — initialize
At this time, open the MySQL directory before, and you will find that there is an additional data file, as follows:

Use the following command to skip mysql

Next, enter the command mysqld — skip grant tables
At this time, the CMD command line will not output anything and can no longer input. We will open another CMD again and run it with administrator privileges. Note: at this time, you need to ensure that the MySQL server runs normally. Use the following command to run MySQL server net start mysql
In the newly opened CMD, switch to the bin directory of MySQL, and then enter the command MySQL – U root – P
At this time, the system will prompt you to enter the password. Since we used mysqld — skip grant tables command before, we will skip the password and press enter to enter the next step<

8. Set password

You can set the password you want. Here I give an example of 123456
Enter the following command update mysql.user set authentication_ string=password(“123456”) where user=“root”;
Then use the following command to refresh Mysql to flush privileges
At this point, the operation is complete. Close all the CMD command lines

9. Check whether MySQL is installed

Open the CMD command line as an administrator and switch to the bin path under mysql. Remember to ensure that your MySQL service is running normally.
Then enter the command MySQL – U root – P
The system will prompt you to enter the password. At this time, you can enter the password you set last time
If the prompt of the CMD command line has changed from the bin directory under Mysql to MySQL >, Congratulations, you have installed mysql. If there are problems during the installation process, please consider from these aspects: whether the MySQL server has been started; whether the corresponding file directory has been switched; whether there is a problem with the configuration file, etc.

Wonderful topic sharing:

Different versions of MySQL installation tutorial

Mysql5.7 installation tutorial

Mysql5.6 installation tutorial

Mysql8.0 installation tutorial

The above is the whole content of this article, I hope to help you in your study, and I hope you can support developeppaer more.