Reputation: 11
MySQL replication is failing with "Duplicate Entry for key 'primary' on query insert into select.." error.
Ticket with detail information is created on forums.mysql.com, please refer below link for detail.
http://forums.mysql.com/read.php?26,539932,539932#msg-539932
Please help if you came across any such scenario.
Thanks, Amit.
Upvotes: 1
Views: 3158
Reputation: 31
"REPLACE INTO"
: deletes old rows before inserting new rows when they have the same PK.
"IGNORE INTO"
: discards new rows and keeps old rows when they have the same PK.
Upvotes: 3
Reputation: 33
Instead of insert into
use insert ignore into
which will solve your problem.
Upvotes: 0