Hand cheap mysql password reset, leading to landing does not go in solution

Morning hand disability, under the MySQL password reset, leading to landing does not go with the command

Since the version of the problem, leading to online methods are not available

Toss the morning, explore + refer to the official documents, and finally get

Use --init-file

The first step, turn off the system service   
         net stop mysql or turn off the system services

Next, create a txt file in the MySQL directory, I take the name is c, in which add the following code

 ALTER USER 'root'@'localhost' IDENTIFIED BY '';

The third step: the command line to start the server

mysqld --init-file=C:\MySQL\mysql-8.0.15\c.txt --console

After the execution, cmd command does not move, this time as an administrator to re-open a new cmd

Execution mysql.exe -u root

use mysql

The most important step: the latest version of mysql password modification method for the next:
the ALTER the User 'root' @ 'localhost' IDENTIFIED by 'root';

The old method of spread of the Internet have failed

Then restart the service, username and password just set, get

Guess you like

Origin www.cnblogs.com/mibao/p/12034761.html