ERROR 1062 (23000): Duplicate entry '2147483647' for key 'PRIMARY'

前端 未结 2 1928
青春惊慌失措
青春惊慌失措 2020-12-20 05:18

First off all, i\'ve seen many others post like this, however the answer wasn\'t working on my particular case. Just in case i am only few months studding SQL, i have no mu

相关标签:
2条回答
  • 2020-12-20 05:26

    INT has a maximum signed value of 2147483647. Any number greater than that will be truncated to that value. What you need to do is change that column to be a varchar(20) which will hold strings of up to 20 characters since bank card numbers are strings and not actually numbers (you don't do math with the). You also should remove AUTO_INCREMENT as that is not a value you will be incrementing.

    0 讨论(0)
  • 2020-12-20 05:46

    Something to ask yourself. How did the number get that big? I did not insert 2 billion rows!

    Well, possibly you 'burned' that many AUTO_INCREMENT ids. This can happen in man ways:

    INSERT IGNORE ... -- when the insert is ignored (because it the row already exists)
    REPLACE
    IODKU
    

    and probably others.

    0 讨论(0)
提交回复
热议问题