Get Current Identity value of mysql

Example:
SELECT `AUTO_INCREMENT`
FROM  INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'DatabaseName'
AND   TABLE_NAME   = 'TableName';
Reset Identity value of mysql
Now I reset the auto_increment

To start with an AUTO_INCREMENT value other than 1, set that value with CREATE TABLE or ALTER TABLE, like this:

Example:
ALTER TABLE tablename AUTO_INCREMENT = 1

Post a Comment

0 Comments