1.关闭mysql服务
2.进去mysql安装目录下的bin路径,输入mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini" --console --skip-grant-tables命令
3.启动mysql服务
4.进去mysql控制台,任意输入密码连接
5.输入update mysql.user set authentication_string=password('123qqq...A') where user='root' and host='localhost';命令重设密码为123456
6.输入FLUSH PRIVILEGES;刷新权限