mysql -uroot -p 连接MySQL8.0时报错:
ERROR 2059 (HY000): Plugin caching_sha2_password could not be loaded
原因是,MySQL 8.0默认用的密码加密插件是 caching_sha2_password ,原来是用的 mysql_native_password 插件。
新建一个 mysql_native_password 插件加密的用户:
create user root@'%' identified WITH mysql_native_password BY 'xxxxx';
grant all privileges on *.* to root@'%' with grant option;
flush privileges;
然后再连接MySQL 8.0就不报错了。