MySQL重置密码

1:停止服务

net stop mysql

2:设置密码为空

mysqld --user=mysql --skip-grant-tables --skip-networking&

3:开启服务

net start mysql 

4:登录

mysql -u root mysql 

5:修改密码

mysql> update user set authentication_string=password('123456') where user='root
' and host='root' or host='localhost';

6:重启服务。然后再登录就可以了。

原文地址:https://www.cnblogs.com/bulrush/p/12299397.html