Re: deleted primary key can't be reused? [message #181916 is a reply to message #181902] |
Sun, 23 June 2013 09:05 |
gordonb.tuxls
Messages: 1 Registered: June 2013
Karma:
|
Junior Member |
|
|
> Just reset the auto increment to 1 and it should jump to the next available empty number, if your first untaken id is 98, then the next insert will take that position.
>
> ALTER TABLE `table_name` AUTO_INCREMENT =1;
Funny, that statement, followed by SHOW CREATE `table_name`,
seems to do nothing successfully. On both MyISAM and InnoDB tables,
MySQL 5.5.31, the auto_increment value doesn't change. I can change
the value to a value max(`column_name`)+1 or higher, but not back to 1.
I still think it used to work at some point. What I'm not sure about
is the part about "jump to the next available empty number", but now
it won't let me set up a test for that.
|
|
|