"Duplicate entry 'X' for key 'YYYY.PRIMARY', Error_code: 1062" appears in MySQL or MariaDB logs
Issue
- Log appears similar to the following:
Duplicate entry ‘XXX’ for key ‘YYYY.PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY
- Data writing operations are failing.
- Database replication cannot proceed normally.
Environment
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- MySQL
- MariaDB
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.