MySQL自增id
2018-05-14 本文已影响0人
寻亦追忆
select last_insert_id();
SELECT auto_increment FROM information_schema.tables where table_schema="db_xxx" and table_name="tbl_xxx";
alter table tbl_xxx AUTO_INCREMENT=123456;
select last_insert_id();
SELECT auto_increment FROM information_schema.tables where table_schema="db_xxx" and table_name="tbl_xxx";
alter table tbl_xxx AUTO_INCREMENT=123456;