1

I have a MySQL table with an auto increment id declared as follows:

create table bases(
    idBase int primary key auto increment,
    nombreBase varchar(50) not null
)

When I insert two records:

insert into bases values('Base 1');
insert into bases values('Base 2');

It should go with id 1 and then 2, but it goes 1 and then 11, if I insert a third takes 21. Is there any particular reason why this is happening?

Thanks in advance!

EDIT!!!!

Solved thanks to the answer provided here

Community
  • 1
  • 1
Josue Martinez
  • 436
  • 5
  • 14
  • 1
    Try running SHOW VARIABLES LIKE 'auto_inc%'; If auto_increment_increment is not 1 then that could be your answer – jeff carey Nov 04 '15 at 21:22
  • I solved thanks to what answered here http://stackoverflow.com/questions/206751/mysql-autoincrement-column-jumps-by-10-why – Josue Martinez Nov 04 '15 at 21:26

1 Answers1

2

IN my search I found some things to help you on your way

  1. Auto skipping numbers-question asked on SO
  2. Insert-Ignore tutorial

Explicitly: Try running this in your db manager

SHOW VARIABLES LIKE 'auto_inc%';
Community
  • 1
  • 1
davejal
  • 6,009
  • 10
  • 39
  • 82