Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Error 1062

forums forums SQLyog Using SQLyog Error 1062

  • This topic is empty.
Viewing 8 reply threads
  • Author
    Posts
    • #8608
      terrym
      Member

      Hi 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

    • #16395
      Ritesh
      Member

      SQLyog logs all query(s) that it executes in the History Tab.

      Can you see '127' being inserted twice?

    • #16396
      Shadow
      Member

      Are 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…

    • #16397
      qwerty007
      Member

      I 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.

    • #16398
      Ritesh
      Member

      Can you send me your table structure and sample data?

      Information about SQLyog and MySQL versions will be helpful.

    • #16399
      qwerty007
      Member

      I 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.

    • #16400
      Ritesh
      Member

      Sorry for the inconvenience caused but our web-server went down for some time 🙁

    • #16401
      Shadow
      Member

      This might explain terrym's problem as well.

    • #16402
      terrym
      Member

      Yes!

      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

Viewing 8 reply threads
  • You must be logged in to reply to this topic.