Results 1 to 2 of 2
have an AUTOINCREMENT field, which works for every record added....1, 2, 3,
my question is this, when i am done testing i want to start at ONE again, but even ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-15-2004 #1Just Joined!
- Join Date
- Oct 2004
- Posts
- 4
Clear an autoincrement
have an AUTOINCREMENT field, which works for every record added....1, 2, 3,
my question is this, when i am done testing i want to start at ONE again, but even if i delete all records, it still keeps SOMWHERE the last UserID,
how do i reset it to 1?
thanks
- 10-23-2004 #2Just Joined!
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 61
If you use the truncate table command to delete your test data then it will reset the auto incrememnt value (unless you are using innodb tables)
http://dev.mysql.com/doc/mysql/en/TRUNCATE.html
Alternatively you can use
To reset the auto_increment valueCode:ALTER TABLE tbl_name AUTO_INCREMENT = 1


Reply With Quote
