---
title: "How to reset AUTO_INCREMENT in MySQL?"  
description: "How to reset AUTO_INCREMENT in MySQL?"  
author: "Revati S Misra"  
published: 2023-04-12  
updated: 2023-04-13  
canonical: https://www.mindstick.com/forum/157766/how-to-reset-auto_increment-in-mysql  
category: "mssql server"  
tags: ["sql server", "sql"]  
reading_time: 1 minute  

---

# How to reset AUTO_INCREMENT in MySQL?

How to reset AUTO_INCREMENT in [MySQL](https://www.mindstick.com/articles/12156/what-is-mysql)?

## Replies

### Reply by Krishnapriya Rajeev

To reset the auto_increment value in MySQL, you can use the ALTER TABLE statement with the AUTO_INCREMENT option. Given below is an example:

Let's say you have a table named my_table with an auto_increment column named *id*. If you want to reset the auto_increment value to start from 1 again, you can use the following SQL statement:

```plaintext
ALTER TABLE my_table AUTO_INCREMENT = 1;
```

This will set the auto_increment value for the *id* column to 1, and the next inserted row will have an *id* value of 1.

If you want to set the auto_increment value to a specific number other than 1, you can replace "1" in the above statement with the desired starting value.


---

Original Source: https://www.mindstick.com/forum/157766/how-to-reset-auto_increment-in-mysql

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
