How to get next auto increment value with query on MySQL

The following select query returns next auto increment value:

SELECT AUTO_INCREMENT
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = "db_name"
AND TABLE_NAME = "table_name"
Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *