Next AUTO_INCREMENT value

less than 1 minute read

To get the next AUTO_INCREMENT value from a table run the following query:

SELECT AUTO_INCREMENT
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = "databaseName"
AND TABLE_NAME = "tableName"

Leave a comment