Faced such a problem: in the database table there is an id field, it is understandable auto-increment. But, for some reason, when adding a record, the field is filled with only odd data (1, 3, 5, 7, 9, etc.). The problem is in general for all database tables. Maybe someone knows what the problem may be?

  • one
    It sounds like you have replication configured. See auto_increment_increment in mysql.cnf - ivan_susanin
  • And can master-master replication really be configured? - Zhukov Roman
  • replication configured, but the data is identical in the databases. A business. Indeed, it was in configs. - Dmitriy
  • @ Dmitry, do you know why this was done? Already managed to restart mysql? :) - Zhukov Roman
  • @ZhukovRoman, no, I do not know. enlighten? - Dmitry

1 answer 1

try the command

SET @@auto_increment_increment=1; 

Update:


The above case applies only to the selected table. If you want this condition to apply to all the tables in the database, then try to make a correction in the my.ini file

 auto-increment-increment = 1 auto-increment-offset = 1 
  • it was valid in configs: auto-increment-increment = 2 auto-increment-offset = 1. - Dmitry