ITMISS
如何在MySQL中从10开始自动递增1:create table foobar( id INT PRIMARY KEY AUTO_INCREMENT, moobar VARCHAR(500)); ALTER TABLE foobar AUTO_INCREMENT=10;INSERT INTO foobar(moobar) values ("abc");INSERT INTO foobar(moobar) values ("def");INSERT INTO foobar(moobar) values ("xyz");select * from foobar;'10', 'abc''11', 'def''12', 'xyz'此自动将id列从10开始递增1。MySQL中的自动增量为5,从10开始:drop table foobarcreate table foobar( id INT PRIMARY KEY AUTO_INCREMENT, moobar VARCHAR(500)); SET @@auto_increment_increment=5;ALTER TABLE foobar AUTO_INCREMENT=10;INSERT INTO foobar(moobar) values ("abc");INSERT INTO foobar(moobar) values ("def");INSERT INTO foobar(moobar) values ("xyz");select * from foobar;'11', 'abc''16', 'def''21', 'xyz'此自动每次将id列增加5,从10开始。