MySQL自增id

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;

你可能感兴趣的:(MySQL自增id)