mySQL auto increment problem: Duplicate entry '4294967295' for key 1

后端 未结 7 866
-上瘾入骨i
-上瘾入骨i 2021-01-25 02:30

I have a table of emails.

The last record in there for an auto increment id is 3780, which is a legit record. Any new record I now insert is being inserted right there.

7条回答
  •  清歌不尽
    2021-01-25 03:09

    It happened to me too. The problem is a silly one.

    If it receives a character string it converts it 0 and if integer, as in my case, where i was trying to insert a mobile no (in india it's 10 digits and starts with 9 like9123456789) into aint` type column.

    However, the limit for signed int is 2147483647.

    I tried converting it to unsigned, but still the limit is 4294967295. Thus error "4294967295" something, but when I converted it to bigint, which has a limit of 9223372036854775807 (which is more for 10 digit mobile no), it started to accept it.

    For the sake of mobile no I converted it to unsigned which increased its limit to 18446744073709551615.

提交回复
热议问题