1

I'm using Workbench. In MySQL auto increment starts from 4 and then increase on 10 each time and I can't do nothing whith it.

  • It is impossible to solve your question without providing more details. Maybe this helps: http://stackoverflow.com/questions/8923114/how-to-reset-auto-increment-in-mysql – Blackbam Dec 15 '16 at 19:29

2 Answers2

0

That could be cause, someone have reseed the auto_increment in which case it will start with the specified value like below, where auto_increment field will start with 100 instead of 1. See Here for more nformation on the same.

ALTER TABLE tbl AUTO_INCREMENT = 100;  

Again, by default the increment counter is 1. That is every new auto_increment value will be incremented by 1 but that can be configured as well using the auto_increment_increment configuration settings.

See InnoDB AUTO_INCREMENT Counter Initialization for more information on the same

Per Documentation On sysvar_auto_increment_increment you can set it like below:

mysql> SHOW VARIABLES LIKE 'auto_inc%';

mysql> SET @@auto_increment_increment=10;
Rahul
  • 76,197
  • 13
  • 71
  • 125
0

Drop the table if possible, then run the following two queries and create the table again.

SET @@auto_increment_increment=1;
SET @@auto_increment_offset=1;
Haroldo
  • 31
  • 2