仅限在mac环境下解决问题
由于MYSQL8.0验证密码的方式改变了

连接Docker启动的mysql出现:ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded

C:mysqldata>mysql -h 127.0.0.1 -P 13306 -uroot -p
Enter password: **
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: ÕÒ²»µ½Ö¸¶¨µÄÄ£¿é¡£

解决方案:

打开终端
进入mysql容器
首先获得超级权限:sudo su

输入绝对路径 /usr/local/mysql/bin/mysql -u root -p

输入密码

登录MySQL后输入:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPassword';

FLUSH PRIVILEGES;


早饭君
150 声望5 粉丝