-
AUTO_INCREMENTThe initial
AUTO_INCREMENTvalue for the table. In MySQL 5.6, this works forMyISAM,MEMORY,InnoDB, andARCHIVEtables. To set the first auto-increment value for engines that do not support theAUTO_INCREMENTtable option, insert a “dummy” row with a value one less than the desired value after creating the table, and then delete the dummy row.For engines that support the
AUTO_INCREMENTtable option inCREATE TABLEstatements, you can also useALTER TABLEto reset thetbl_nameAUTO_INCREMENT =NAUTO_INCREMENTvalue. The value cannot be set lower than the maximum value currently in the column.
MySQL基础知识---------AUTO_INCREMENT
最新推荐文章于 2021-02-02 09:24:23 发布
本文详细介绍了MySQL中AUTO_INCREMENT选项的用法,包括如何设置初始AUTO_INCREMENT值,以及如何通过ALTER TABLE语句重置AUTO_INCREMENT值。重点强调了不支持AUTO_INCREMENT表选项的引擎的特殊处理方式。
217

被折叠的 条评论
为什么被折叠?



