Method for resetting the auto-increment start value of various MySQL data table types bitsCN.com
Methods for resetting the auto-increment start value of various MySQL data table types
MyISAM data table
After a record with the maximum number is deleted, the number cannot be reused.
You can use the "AUTO_INCREMENT = n" option to specify an auto-increment initial value when creating a table,
After creating a table, run the alter table table_name AUTO_INCREMENT = n command to reset the start value of auto-increment.
HEAP data table
The auto-incrementing column is allowed for HEAP data tables starting from MySQL4.1.
You can use the "AUTO_INCREMENT = n" option to specify an auto-increment initial value when creating a table. after the table is created, use the alter table table_name AUTO_INCREMENT = n command to reset the start value of the auto-increment.
BDB data table
You cannot use the "AUTO_INCREMENT = n" option to specify the auto-increment initial value in create table, or use the alter table table_name AUTO_INCREMENT = n command to change the auto-increment initial value.
InnDB data table
You cannot use the "AUTO_INCREMENT = n" option to specify the auto-increment initial value in create table, or use the alter table table_name AUTO_INCREMENT = n command to change the auto-increment initial value.
BitsCN.com