3 ms·
The autoincrement number is stored just fine unless you erase the last record and then stop Mysql, in which case that last one is lost and reused when you resta
by davidw 13y ago
The autoincrement number is stored just fine unless you erase the last record and then stop Mysql, in which case that last one is lost and reused when you restart Mysql. This can cause problems if, for instance, you did something with that record between the time it was created and deleted and used that ID...
http://stackoverflow.com/questions/3718229/stop-mysql-reusing-auto-increment-ids http://stackoverflow.com/questions/3718229/stop-mysql-reusin...
http://dba.stackexchange.com/questions/16602/prevent-reset-of-auto-increment-id-in-innodb-database-after-server-restart http://dba.stackexchange.com/questions/16602/prevent-reset-o...
- laumars 13y agoI've done exactly what you've described and never ran into that problem. Quite the opposite in fact, on some dev servers I've have to manually fudge the auto increment number because it didn't automatically reset to zero after I'd flattened the table. Like I said before, you can even create an empty table and define the auto increment to be 10000 if you wanted. So there is a persistent value that's stored. However I suspect the issue here is that I'm using a different MySQL engine to yourself.