mysql8.0 Forgot Password Change Password

1. modified in cmd

    1.1 Administrator cmd into the mysqld --console --skip-grant-tables --shared-memory  

    1.2 At this point, can not continue to enter commands (if you can continue to enter the command, is likely not closed the original mysql service net stop mysql close it), then re-open an administrator cmd window to log into mysql -u root

    1.3 change the root password update mysql.user set authentication_string = '' where User = 'root'; the experience of their own after stepping pit: first set the password is blank, or log on to another may not, anyway, I have not had a successful login.

    1.4 cmd and then close all windows, re-open a cmd window, restart the mysql service (net start mysql), enter the mysql (mysql -u root -p, appeared passwrod, you can enter directly enter)

    Change password is then 1.5 ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'root';

2. If you are using Navicat can login, change is very simple

   2.1 

   2.2 

Guess you like

Origin blog.csdn.net/qq_43118311/article/details/91418402