在从库上执行 show slave status\G 命令
显示报错:
Last_IO_Error: error connecting to master 'repluser@188.131.212.XX:3309' - retry-time: 60 retries: 2 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
分析报错,应该是连接的用户配置有问题。
所以去主库mysql上查询当前用户信息
SELECT plugin FROM `user` where user = 'repluser';
原来是主库repluser的plugin是caching_sha2_password 导致连接不上,修改为mysql_native_password即可解决。
ALTER USER 'repluser'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
修改后,重新配置从库binlog位置后重启状态展示如下: