Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This issue is showing it a duplicate key, but when I verify I could understand that one column having varchar(5) and the insert is having more than 5 character, normally it will get truncated and will get inset. But here it is giving error.

Error 'Duplicate entry '7565371' for key 'PRIMARY'' on query. Default database: 'dbname'. Query: 'insert into dbname.tablename .....

share|improve this question
    
If your data doesn't fit into your database then you've got more problems than just replication. –  symcbean Jun 12 '12 at 10:25
add comment

closed as off topic by John Gardeniers, EightBitTony, voretaq7 Oct 27 '12 at 17:33

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

The insert may have more than 5 characters but I'd say that after it's truncated the 5 characters remaining are what is causing your duplicate key. I'd also suggest not using a varchar for such a small field, as the overhead is just not worth the minuscule storage you're saving.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.