Auto increment gets reset to 0 every time the service restarts

It has worked so far, but when I restart the service, the database has lost the auto-increment value for my table. This is probably something I do with my queries because I have not recently modified my tables. What could it be?

+5
source share
2 answers

This is documented behavior, this is not a mistake.
When the server starts, it goes through each table (InnoDB), which determines what the new auto_increment value should be. From http://dev.mysql.com/doc/refman/5.0/en/innodb-auto-increment-handling.html :

InnoDB . , InnoDB , .

- DDL, , , engine - , .

+2

ALTER TABLE _ ENGINE = MyISAM

. InnoDB AI , reset + 1 mysql. , , reset 1.

MyISAM, , .

0

All Articles