MySQL Forums
Forum List  »  Newbie

How to find next AUTO_INCREMENT value of a table in MYSQL 8
Posted by: Rahul Madhani
Date: June 07, 2018 02:09PM

I was using below query to find next AUTO_INCREMENT value of table in MYSQL 5.7
SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'TABLENAME' AND TABLE_SCHEMA = DATABASE( );

But same query in MYSQL 8 is returning NULL. I have used above query in my application which works fine with MYSQL 5.7 but behaves strangely with MYSQL 8.

Can any body please suggest me how to find next AUTO_INCREMENT value in MYSQL 8.

Also if there is common query which works in both (MYSQL 5.7 and 8) then it would be very helpful.

Options: ReplyQuote


Subject
Written By
Posted
How to find next AUTO_INCREMENT value of a table in MYSQL 8
June 07, 2018 02:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.