I've got several tables in a database, let's say they're called table1, table 2, etc.
All tables have a primary key column 'id' with auto-increment.
In my current configuration it happens that when inserting into table1, the generated id is 1.
Afterwards when inserting into table2, the generated id happens to be 1 as well.
How to force absolutely unique ids across all tables in a database? I want when inserting into table1, generated id to be 1, and if afterwards inserting into table2, generated id be 2?
I used mysql server on some machine and did not have this problem, but when I installed mysql on my local machine, it started to occur. So I guess it must be some kind of a setting that is applied to the mysql configuration?
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…