Friday, October 21, 2011

MySQL Auto increment resetting

Just a little note to myself. Should you ever need to change the 'next id' in a table with a primary key that auto-increments, use the sequel below:


ALTER TABLE tablename AUTO_INCREMENT = 200000;


This will mean that the next time a row is added to 'tablename', it's auto-increment id will be '200000'

No comments: