So it works ...
ALTER TABLE variation AUTO_INCREMENT = 10;
But I want to do it;
ALTER TABLE variation AUTO_INCREMENT = (SELECT MAX(id)+1 FROM old_db.varaition);
but this does not work, and does not:
SELECT MAX(id)+1 INTO @old_auto_inc FROM old_db.variation ALTER TABLE variation AUTO_INCREMENT = @old_auto_inc;
So does anyone know how to do this?
(I'm trying to ensure that the AUTO_INCREMENT keys do not collide between the old and the new site and should do this automatically. Therefore, I can just run the script when the new db goes live)
source share