Answer the question
In order to leave comments, you need to log in
Is it possible to set the field as auto increment after some time?
In general, there is a table, there are some data in it and there is an id field.
The previous developer did not make it auto-increment and when adding new records, he simply retrieved the last id and did +1.
Now we need to fix it without spending much time.
In fact, we know the maximum id in the table, can we "translate" id to autoincrement? Well, I know how to set the next value
Answer the question
In order to leave comments, you need to log in
ALTER TABLE `yourtable` MODIFY COLUMN `id` INT auto_increment
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question