Home  >  Forum  >  Database
Post New Query

How to reset AUTO Increment in MySQL


joined on
April 01,2014
Asked on November 29,2014
Hi, How can I reset AUTO Increment in MySQL database.
In my database, auto increment is incremented like 2000, 2001 where as max  element is 500.
How to fix it safely?
joined on
March 14,2013
Replied on November 29,2014

Suppose you have a table A, and you need to reset the Auto Increment, run the query as below.

ALTER TABLE A AUTO_INCREMENT=500

I would suggest that take the backup of database before running the query.

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us