Skip to content
Advertisement

Tag: auto-increment

Change mysql auto increment id column value

I have a mysql table with an gpid AUTO_INCREMENT NOT NULL UNIQUE column. After filling this table (which has 50M+ entries), I have realized that mysql still increments AUTO_INCREMENT columns if transaction fails because of an IntegrityError, and understandably so. The results are gaps in AUTO_INCREMENT columns, with gpid jumping values (for exemple from gpid == 3 to gpid ==

Advertisement