Windows 10 failed to install mysql? Use the compressed package to install mysql 8.0 and modify the root user to allow remote login (valid for pro-test)

mysql8.0 uses msi to install the package, but it always fails. Finally, the following method is used to successfully install.
1. Download the installation package and
go to the official website to download , the version I downloaded is 8.0.25

Insert picture description here


Insert picture description here

2. After downloading, unzip, unzip the zip package to the directory you want to install, my path is: D:\mysql-8.0.25-winx64

3. Configure environment variables:
enter Computer—Properties—Advanced System Settings—Environment Variables, and add the path for MySQL decompression.

Insert picture description here


4. Next, configure the MySQL configuration file

Open the folder D:\mysql-8.0.15-winx64 just decompressed, create a configuration file as my.ini (new txt file, rename, change the suffix), edit my.ini to configure the following basic information:

[mysql]
default-character-set=utf8

[mysqld]
port=3306
basedir=D:\mysql-8.0.25-winx64
datadir=D:\mysql-8.0.25-winx64\data
character-set-server=utf8
default-storage-engine=INNODB

5. Start the MySQL database:

Open the cmd command line tool as an administrator, switch the directory to D:\mysql-8.0.25-winx64\bin and
enter the initialization command: mysqld --initialize-insecure --user=mysql

Insert picture description here


in D:\mysql-8.0.25- Generate data directory under winx64\bin directory

Start and enter the following command:

net start mysql

Insert picture description here


mysql service has been started at this time

However, it is not possible to connect to the database remotely at this time. If you want to connect to the database remotely, you need to do the following:
1.
Stop the mysql service net stop mysql

Insert picture description here

Find my.ini in the mysql installation directory, find [mysqld] in it, and add this sentence below: skip_grant_tables (skip the authorization table authentication when starting the MySQL service), remember to save it.  

Insert picture description here

Find the bin directory of myql in cmd, and then enter the command: mysql -u root -p
without entering a password, press Enter

Insert picture description here


4. Enter (the following 123 is the password of the root user, change to the password you want):
use mysql;
ALTER USER'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123';
flush privileges;
quit;

Insert picture description here


5. Remove skip_grant_tables in my.ini and restore the authorization table authentication when logging in (remember)

6. Restart the mysql service, and then log in with root and the modified password: mysql -u root -p

Then enter the password to verify. Successful entry means success.

At this time, you can log in remotely as root user by using tools such as SQLyog.

Insert picture description here