It worked until now but when i restart the service, the database lost the auto-increment value for my table. It's for sure something i do with my queries, because i didn't modified my tables recently. What could it be?
That is the documented behaviour, it's not a bug.
When the server starts up, it goes through each (InnoDB) table determining what the new auto_increment value should be. From http://dev.mysql.com/doc/refman/5.0/en/innodb-auto-increment-handling.html :
InnoDB uses the in-memory auto-increment counter as long as the server runs. When the server is stopped and restarted, InnoDB reinitializes the counter for each table for the first INSERT to the table, as described earlier.
It does something similar when you deploy DDL that causes a table rebuild, such as altering the engine
-- even altering it to the same value it was before.
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