windows10mysql password forgotten how to do?

  • Run as Administrator console, shut down MySQL service
net stop mysql

Here Insert Picture Description

  • Skip the grant tables, conduct free secret login
mysqld --console --skip-grant-tables --shared-memory

Here Insert Picture Description

  • Open a new console window with administrator, and then password-free login Mysql
mysql

Here Insert Picture Description

  • Mysql database using MySQL
use mysql

Here Insert Picture Description

  • To change the root password is empty. Special attention authentication_string = '' equal sign is single quotes
update mysql.user set authentication_string=' ' where user='root';

Here Insert Picture Description

  • Query root on the basis of the previous step on the user group and password
select host,user,authentication_string from mysql.user;
# 修改之后可以看到,root用户的密码已经为空

Here Insert Picture Description

  • Open a new window to start the MySQL service
net start mysql

Here Insert Picture Description

Published 78 original articles · won praise 82 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_43395428/article/details/104797680