How to set the mysql auto-increment value has a mysql table structure: CREATETABLEIFNOTEXISTS 'dizeng' (& nbsp; 'id' int (11) NOTNULLAUTO_INCREMENT, & nbsp; 'Reid 'int (11) DEFAULTNULL, & nbsp; 'name' varchar (255) DE
There is a mysql table structure as follows:
Create table if not exists 'dizeng '(
'Id' int (11) not null AUTO_INCREMENT,
'Reid 'int (11) default null,
'Name' varchar (255) default null,
'Idshow' tinyint (4) not null default '1 ',
Primary key ('id ')
) ENGINE = MyISAM default charset = utf8 AUTO_INCREMENT = 1;
Insert data in local debugging:
Insert into dizeng (reid, name) values (0, 'XXX'); in this way, 10 data records are inserted cyclically. However, the field IDs are arranged as follows:
2, 4, 6, 8, 10, 12... the incremental value is 2.
Similarly, I take the dizeng table to another machine. The field di is a normal incremental value of 1, and the id sorting is:
1, 2, 3, 4, 5, 6 ....
I don't know why. how can I restore the mysql incremental value on my local end to normal? 1. Thank you!
------ Solution --------------------
Try again after deletion
------ Solution --------------------
First run SET @ auto_increment_increment = 1;
Or write the configuration file auto_increment_increment = 1 and restart