Re: Resetting auto_increment
| From: | Toby Hart Dyke | Date: | Tue, 14 Dec 2010 18:43:38 +0000 |
| Subject: | Re: Resetting auto_increment | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47537@lists.php.net to get a copy of this message | ||
On 12/14/2010 1:02 PM, Ethan Rosenberg wrote:
At 12:38 PM 12/14/2010, Daniel Brown wrote:Use 'ALTER tablename AUTO_INCREMENT=1' rather than 'UPDATE tablename AUTO_INCREMENT=1'. TobyOn 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 startfrom 1.The primary key is now 2421. I have deleted all the data in thetable andstarted over, and the primary key just increments from its previousvalue.Setting auto_increment=0 does not work for me, why I don't know.====== Daniel - Thanks. This is what I get - mysql> update Visit3 auto_increment=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=1' at line 1UPDATE tablename AUTO_INCREMENT=1;-- </Daniel P. Brown> Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/