使用SQLyog无法连接到MySQL,error code 2013_MySQL


打开cmd进入到MySQL:

mysql -uroot -p password

输入以下语句执行命令:

alter user 'root'@'localhost' identified by 'password' password expire never; #修改加密规则 

alter user 'root'@'localhost' identified with mysql_native_password by '原密码'; #更新一下用户的密码

flush privileges; #刷新权限

重置密码:

alter user 'root'@'localhost' identified by 'password';//此处password为新密码