找到my.ini,搜索“[mysqld]”,在其下一行加上“skip-grant-tables”,保存并退出.
重启MySQL服务
进入mysql 命令行
use mysql;
update user set authentication_string=password("123456") where user="root";
flush privileges;
use mysql;
update user set authentication_string=password("123456") where user="root";
flush privileges;
use mysql;
update user set authentication_string=password("123456") where user="root";
flush privileges;