8.0不同于之前版本。
mysql8.0 之前的版本加密规则是mysql_native_password,mysql8之后,加密规则是caching_sha2_password。
解决方法把mysql用户登录密码加密规则还原成mysql_native_password
之前版本:
grant all privileges on *.* to 'root'@'%' identified by `12345678` with grant option;
8.0版本:use mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345678';
FLUSH PRIVILEGES;