amit shah
amit shah

Reputation: 11

Mysql Replication: Duplicate Entry for Key 'primary' on query insert into select

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

Answers (2)

vjerez
vjerez

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

Abhijit
Abhijit

Reputation: 33

Instead of insert into use insert ignore into which will solve your problem.

Upvotes: 0

Related Questions