这个是因为,mysql8之前的版本使用的密码加密规则是mysql_native_password,但是在mysql8则是caching_sha2_password,所以需要修改密码加密规则。
1、进去mysql 8.0 command line client
2、输入 use mysql 和 select user,host,plugin,authentication_string from user;
alter user ‘root’ @‘localhost’ identified with mysql_native_password by ‘123456’;
就ok 存档