I realise that this is an old question but I recently had a related issue that might be helpful to others. There may be circumstances where it is desirable to reset the auto_increment value but probably never necessary to do so. I have a form script that creates a new record whenever the script is called because the (auto_incremented) id number is needed for the process to proceed. If the user abandons the new record creation then the record is deleted which in most circumstances is fine. However, this leaves gaps in the id numbers and my client wants them to be contiguous. The solution for me was to reset the auto_increment number after deleting but I needed to be sure that no other user had created another record during this process. The solution was to use
$db->query("ALTER TABLE table_name AUTO_INCREMENT = 1");
This will reset the auto_increment number to the next available number so no problem if another user has created a new record meanwhile (unlikely in this case) except it will still leave a 'gap' in the numbers if a previous id number is then deleted. As the record was deleted anyway there was no implication regarding links to other tables etc. My client was happy with this possibility so that was the solution I used.