i have an existing mysql table with the id column defined as primary, and auto-increment set as true. now, i would like to know if i can set the auto-increment to start from a predefined value, say 5678, instead of starting off from 1.
I would also like to know if i can set the steps for auto-incrementing, say increase by 15 each for each new record insertion (instead of the default increment value of 1).
Note- i am using phpmyadmin to play with the db, and i have many tables but only one db.
Thanks.
You can also use the server-system-variables:
auto_increment_increment
and
auto_increment_offset
This will allow you to increase the offset by other values than 1 (e.g. 15) each time.
If you start from a different value using the same offset on a different server. This will allow you to keep tables on different servers that can be merged without keys overlapping.
e.g.
This can be very useful.
Because the main usage is to have the same table on different servers behave in a different way, it is a server setting and not a table setting.