mysql forgot password reset password

The first step: output cmd in the run, log in;

 

Step 2: Stop the mysql service, the command is: net stop mysql  Note, if not, switch the current directory to the mysql\bin directory for operation;
Step 3: Enter in the cmd command line: mysqld --defaults-file="D:\mysql\mysql5.6.24\my.ini" --skip-grant-tables

 

Step 5: Enter mysql mode: mysql -u root

 

             修改密码: UPDATE mysql.user SET Password=PASSWORD("newpassword")   WHERE User = 'root'  and Host='localhost';

 

             Load the privilege table to make the new password take effect: FLUSH PRIVILEGES;

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326714771&siteId=291194637
Recommended