How to view auto_increment value for a table

The only way I know is show create table MyTable

+7
mysql auto-increment
source share
3 answers
 SELECT `AUTO_INCREMENT` FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = SCHEMA() AND `TABLE_NAME` = 'tbl_name'; 
+9
source share
 SHOW TABLE STATUS LIKE "tablename"; 

the auto_increment column will display the score.

+10
source share

You can use LAST_INSERTED_ID .

+1
source share

All Articles