update mysql.user set authentication_string=”” where user=”root”;
alter user ‘root’@’localhost’ IDENTIFIED BY ‘123456’
修改加密前,authentication_string字段显示
+——————+———–+————————————————————————+
| user | host | authentication_string |
+——————+———–+————————————————————————+
| root | localhost |
A
A
<script type="math/tex" id="MathJax-Element-27">A</script>005$5-#]j
}Quyowc>TUbR5ItcKagjQi7/3Eqf3JZrOY/Ag6VRS/yZYkFKh2A |
连接失败是由于加密方式不一样了。。。
//修改加密方式
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER;
//修改密码
alter user ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘123456’;
//刷新权限
FLUSH PRIVILEGES;
修改加密后,authentication_string字段显示
+——————+———–+————————————————————————+
| user | host | authentication_string |
+——————+———–+————————————————————————+
| root | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9