MySQL: Script to find Last AUTO_INCREMENT value for a Table

In this post, I am sharing script to find last updated AUTO_INCREMENT of a MySQL Table.

Generally, we use LAST_INSERT_ID() function to get last updated AUTO_INCREMENT value for particular running session. This function basically we use with any procedure block and it will return last updated AUTO_INCREMENT value of the last executed statement.

At the other side, Database Administrator also require to find last updated AUTO_INCREMENT value for any table and wants to generate report for that.

Below is a script to find last updated AUTO_INCREMENT value:


Using STATUS command:

Please visit other related Article !
MySQL: Get ID of the Last Updated Row

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

Be the First to Comment!

Notify of