1、auto_increment的複位
ALTER TABLE your_table_name AUTO_INCREMENT = 1
2、The AUTO_INCREMENT attribute can be used to generate a unique identity for new rows。樣本:
CREATE TABLE animals (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
INSERT INTO animals (name) VALUES
('dog'),('cat'),('penguin'),
('lax'),('whale'),('ostrich');
3、No value was specified for the AUTO_INCREMENT column, so MySQL assigned sequence numbers automatically. You can also explicitly assign NULL or 0 to the column to generate sequence numbers.
參考
【1】 關於auto_increment的一個應用討論
http://www.iteye.com/topic/198779
【2】 mysql官網
http://www.w3school.com.cn/sql/sql_datatypes.asp
http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
http://dev.mysql.com/doc/refman/5.1/zh/column-types.html#numeric-type-overview
【3】 使用auto_increment經驗總結
http://www.frostsky.com/2011/04/mysql-auto_increment-2/
【4】 總結的不錯
http://www.bhcode.net/article/20090219/4161.html