开发者

Duplicate entry '6343' for key 'PRIMARY'

开发者 https://www.devze.com 2023-03-21 04:39 出处:网络
I\'ve begun receiving the above error when trying to add a record to a database. The column in question is set to \'auto_increment\' and is of datatype \'INT\' with a length of 10.

I've begun receiving the above error when trying to add a record to a database. The column in question is set to 'auto_increment' and is of datatype 'INT' with a length of 10.

Looking around online I can see that this error can occur when an auto incremented column reached its u开发者_如何转开发pper limit - however in this instance the table only contains 6342 records, and the column should be able to hold much more.

Indeed, the application in question is used in several installations and in some cases the equivalent table with an identical structure has many more records than this without generating an error.

Stranger still, when I changed the datatype of this column to 'BIGINT', it resolved the issue - even though on other installations it remains the same with more records.

Can anyone suggest any reasons why this issue may have occurred?

Thanks in advance.


It sounds like your auto_increment_offset server variable somehow got set to 6343. You can find more information here.

0

精彩评论

暂无评论...
验证码 换一张
取 消