auto increment - How is MySQL's AUTO_INCREMENT column reset -


few question resetting mysql's auto_increment column.

first without deleting/creating table, or deleting rows via truncate table (see footer code) -- correct way it?

alter table [insert_table_name] auto_increment = 1 

next, value set 0 or 1 -- , why?

bonus, advice.

it's set whatever use in alter table query, 1 in case. however, since you're not deleting rows, you've set primary key violation, since next inserted row try use 1 , conflict created row same key.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -