funbinod Posted April 26, 2014 Share Posted April 26, 2014 hi all! is there any idea to reset a mysql table's auto_increment field to restart from "1" after emptying it? Link to comment Share on other sites More sharing options...
birbal Posted April 26, 2014 Share Posted April 26, 2014 using TRUNCATE will set AI to 0 as well as empty the table. http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCkQFjAA&url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.0%2Fen%2Ftruncate-table.html&ei=x4NbU9reJsSXrAe94IDgDg&usg=AFQjCNGl0K-EgA3InY7R303XP6MwoNTFOw&bvm=bv.65397613,d.bmk Link to comment Share on other sites More sharing options...
funbinod Posted April 26, 2014 Author Share Posted April 26, 2014 (edited) thank u friend! it did a great help. really glad. Edited April 26, 2014 by funbinod Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now