I am inserting say 500 rows using INSERT IGNORE, if the row already exists (based on a unique field) then it simply does nothing, if not it inserts the row.
My problem is that say only 10 do NOT exist the auto increment still increases for every insert so it goes up by 500 so I end up with gaps in my id's. How do I stop this?
I have tried:
SET global innodb_autoinc_lock_mode = 0;
But I get the error:
1238 - Variable 'innodb_autoinc_lock_mode' is a read only variable
How do I change this?