How to reset the primary key of a table?

Kaveh picture Kaveh · Nov 27, 2009 · Viewed 70.9k times · Source

In my table tbphotos I had a 100 records. I then deleted all the records and now that I want to restart data entry I see that my primary key doesn't start from 1, but it starts from 101,

Is there any way to reset the primary key?

I am using MySQL administrator account.

Answer

Donnie picture Donnie · Nov 27, 2009

alter table foo AUTO_INCREMENT = 1