mysql 从库重置同步

一 问题

巡检发现mysql5.7的主从库有一个从库与主库断开同步,应该是版本升级时主从不同步,原从库变为主了,而原主库变为从库了,且数据比现在主库多。

2023-11-14T15:23:00.919194+08:00 2 [ERROR] Slave SQL for channel '': Could not execute Write_rows event on table xxxxx.xxxxxxx; Duplicate entry '11913053' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000016, end_log_pos 10355, Error_code: 1062 2023-11-14T15:23:00.919221+08:00 2 [Warning] Slave: Duplicate entry '11913053' for key 'PRIMARY' Error_code: 1062 2023-11-14T15:23:00.919231+08:00 2 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000016' position 10088.