DUPLICATE ENTRY '127' FOR KEY 1
If you are using MySQL and you are facing the error “duplicate entry ‘127’ for key 1” while trying to make an entry in your database table, do not panic. This should be linked to the following and can easily be solved as indicated below:
- When the primary key of a table is set to TINYINT,
- The TINYINT capacity is less than 1 byte.
- A TINYINT field can normally seize only 128 values
Solution
To solve this issue, you can choose two solutions:
- 1. Either you try to use a different table command to increase the auto-increment value of the field,
- 2. Choose the primary key from a TINYINT to an INT type.
See also :
http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html
You can also post your probleme on our kioskea forum which you can accessed on below link:
http://en.kioskea.net/forum/forum 3 programming