Re: Resetting auto_increment
| From: | Daniel Brown | Date: | Tue, 14 Dec 2010 17:38:09 +0000 |
| Subject: | Re: Resetting auto_increment | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47535@lists.php.net to get a copy of this message | ||
On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg <ethros@earthlink.net> wrote:
> Dear List -
>
> Thanks for all your help.
>
> How do I reset auto_increment so that the primary key will start from 1.
> The primary key is now 2421. I have deleted all the data in the table and
> started over, and the primary key just increments from its previous value..
> Setting auto_increment=0 does not work for me, why I don't know.
UPDATE tablename AUTO_INCREMENT=1;
--
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/