Failed to read auto-increment value from storage engine, Error Number: 1467

后端 未结 9 875
[愿得一人]
[愿得一人] 2020-12-16 02:54

When inserting data in mysql i get this error:

Error Number: 1467 Failed to read auto-increment value from storage engine

I don\'t now how to solve this i

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 03:33

    To add a little comment to kiddingmu's answer: it is not just a question of the number of digits, but also of the range of the datatype. If the column is INT(11), the 11 says that 11 digits are used for display; but this does not release the constraint that INT can only encode the range -2147483648:2147483647 when signed, and 0:4294967295 when unsigned.

    So: for an INT(11) column, an AUTO_INCREMENT of 10000000000 will work; an AUTO_INCREMENT of 90000000000 will not, despite it being 11 digits.

    If a larger range is needed, then another type should be used, like BIGINT.

提交回复
热议问题