Is it possible in MySQL to set the starting value of a primary key index, so it starts at say 15 instead of 1?
A quick hack would be to write a loop of 14 junk entries, add the correct data then delete the first 14 entries but I would be interested to know if it is possible in a neater way!
The reason for doing this is the overhaul of an existing site where indexes don't all start at 1 but they are used to link items in different tables
Yes, the auto increment start position can be changed by altering the table.
ALTER TABLE t AUTO_INCREMENT = ?;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With