出现Authentication plugin 'caching_sha2_password' 的原因及 解决方案,MySQL 8.+ 修改密码策略。
MySQL8.0采用了新的更安全的验证方式,https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/
mysql -u root -p
数据mysql安装时设置的密码
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
或者
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;