forums › forums › SQLyog › Using SQLyog › Error 1062
- This topic is empty.
-
AuthorPosts
-
-
October 12, 2004 at 9:32 pm #8608
terrym
MemberHi all
I have setup a simple table in a MySQL Database. It has 7 fields. The first, id, is an int field and is the primary index, and it is also autoincrementing. The other 6 fields are text fields.
I have started entering data. I can enter data for id number 127 and everything looks normal. But as soon as I start entering data for id 128, I get the following error:-
Error No. 1062
Duplicate entry '127' for key 1
The only way I can then get out of this is by cancelling. I cannot see another id with 127. I have re-started, and re-booted, but every time I try to enter past id 127, I get this error?
Can onyone throw some light on this?
Thanks
-
October 13, 2004 at 3:19 am #16395
Ritesh
MemberSQLyog logs all query(s) that it executes in the History Tab.
Can you see '127' being inserted twice?
-
October 13, 2004 at 11:20 am #16396
Shadow
MemberAre you sure that your PK field is of integer type? Isn't it accidentally a signed tinyint? The error message may be caused by overflow…
-
October 13, 2004 at 9:24 pm #16397
qwerty007
MemberI am getting the exact same error
Error No. 1062
Duplicate Entry '2' for key 1
There is no duplicate. I only have 2 entries in this table. They are both numbers.
21197
21385
That's it.
I can't find a reason for this error.
-
October 14, 2004 at 6:53 am #16398
Ritesh
MemberCan you send me your table structure and sample data?
Information about SQLyog and MySQL versions will be helpful.
-
October 14, 2004 at 12:43 pm #16399
qwerty007
MemberI figured it out. (Tried to post yesterday but the site seemed to be down)
My field length was only set to 1, so MySQL was only taking the first number (in this case '2') when I was trying to manually enter data. My mistake.
-
October 14, 2004 at 3:07 pm #16400
Ritesh
MemberSorry for the inconvenience caused but our web-server went down for some time 🙁
-
October 14, 2004 at 3:31 pm #16401
Shadow
MemberThis might explain terrym's problem as well.
-
October 15, 2004 at 10:50 pm #16402
terrym
MemberYes!
That's the problem. My id field was a tinyint, which only allows numbers up to 127.
At least we won't get that wrong again?
Thanks
Terry
-
-
AuthorPosts
- You must be logged in to reply to this topic.