mysql / mariadb database table when inserting Data, ID & increased even an odd number? By reading the following content to know how to deal with.

Today, suddenly asked a question, when mysql database data into a table, set the ID increment, but after inserting data, ID actually was odd to increase, not the type 123456, but 13579 form, suddenly bit ignorant, studied for a while, auto_increment found to be a long step problem, the following specifically at how to solve:

Increased by an odd number in the table ID after insert data occurs, as shown below:

 

View increment step: show variables like 'auto_increment%';

 

 The self-energizing step to the 1: set @@ auto_increment_increment = 1;

 

At this time, the data table emptied with truncate it reinserted

 

 

 

 @@ figure name and the following is purely experimental use, any questions please contact the bloggers deletion!


Guess you like

Origin www.cnblogs.com/7758chongzi/p/11718022.html