D
D
deadnice2020-12-24 02:20:14
MySQL
deadnice, 2020-12-24 02:20:14

How to resolve the duplicate primary key error during replication (without skipping it)?

I'm moving to Amazon RDS MySQL. I set up master and slave according to their guide, made the dump necessary for replication, imported it to the slave, and at the start of replication I caught a duplicate key error.

Last_SQL_Errno: 1062
               Last_SQL_Error: Error 'Duplicate entry '3468603' for key 'users.PRIMARY'' on query. Default database: '~somedbname~'. Query: 'INSERT INTO users
        SET ~some insert data~'

At the moment, the master and slave data are slightly different in the key '3468603'.

UPD! Most likely due to the large version difference between MySQL 5.5.53 master -> 8.0.21 slave can you confirm this in the comments?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2020-12-24
@vitaly_il1

That is, you have a local master, and RDS - slave?
Perhaps you started replicating from the wrong position?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question