Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. Error_code: MY-002061
主從復(fù)制出現(xiàn):Slave_IO_Running: Connecting
原因

解決辦法
方法1:修改創(chuàng)建的slave賬號身份驗證插件
ALTER USER slave IDENTIFIED WITH caching_sha2_password BY 'password';
或者
ALTER USER slave IDENTIFIED WITH sha256_password BY '1234';
在這里,我看到其他人的帖子,change master的時候,多加了一個參數(shù)GET_MASTER_PUBLIC_KEY=1,但是我沒有加,也出現(xiàn)兩個yes。詳細點擊:blog
方法2:master的my.cnf配置添加,重啟
如果您的MySQL安裝必須為8.0前客戶端提供服務(wù),并且您在升級到MySQL 8.0或更高版本后遇到兼容性問題,那么解決這些問題并恢復(fù)8.0前兼容性的最簡單方法是重新配置服務(wù)器以恢復(fù)到之前的默認身份驗證插件
default_authentication_plugin=mysql_native_password
Access denied for user 'slave'@'127.0.0.1' (using password: YES), Error_code: MY-001045
我是:master_ip應(yīng)該寫docker 中master的ip地址。
docker inspect mysql-master

如果你出現(xiàn)類似問題,一般就是配置的參數(shù)出現(xiàn)等原因,查看賬號,密碼,權(quán)限,ip,port,等配置的參數(shù)。
master_host:主數(shù)據(jù)庫的IP地址;
master_port:主數(shù)據(jù)庫的運行端口;
master_user:在主數(shù)據(jù)庫創(chuàng)建的用于同步數(shù)據(jù)的用戶賬號;
master_password:在主數(shù)據(jù)庫創(chuàng)建的用于同步數(shù)據(jù)的用戶密碼;
master_log_file:指定從數(shù)據(jù)庫要復(fù)制數(shù)據(jù)的日志文件,通過查看主數(shù)據(jù)的狀態(tài),獲取File參數(shù);
master_log_pos:指定從數(shù)據(jù)庫從哪個位置開始復(fù)制數(shù)據(jù),通過查看主數(shù)據(jù)的狀態(tài),獲取Position參數(shù);
master_connect_retry:連接失敗重試的時間間隔,單位為秒。
master執(zhí)行:show grants for 'slave'@'%'; 查看創(chuàng)建的slave用戶權(quán)限。