What will happen if the MySQL AUTO_INCREMENT column reaches the upper limit of the data type?


When the AUTO_INCREMENT column reaches the upper limit of data type then the subsequent effort to generate the sequence number fails. That is why it is advised to use a large enough integer data type for the AUTO_INCREMENT column to hold the maximum sequence value required by us. For example, if we will use TINYINT then AUTO_INCREMENT would be able to generate only 127 sequence numbers and in case of UNSIGNED TINYINT, this value can be extended up to 255.

Updated on: 30-Jul-2019

624 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements