Friday, March 09, 2012

MySQL Exception : Duplicate entry '65535' for key 1

If you have auto-increment integer key in MySQL you might hit the upper  limit for SMALLINT when total rows = 65535 and get an error like :-


#1062 - Duplicate entry '65535' for key 1 


In such cases just change the structure of the table and change the datatype to MEDIUMINT or BIGINT

No comments:

Post a Comment

Thank you for your feedback