Mar 19 2009

reset auto increment integer in mysql

Because I use auto-increment integers in almost every table I can for the primary key, they tend to get very large very fast. This can sometimes be an annoying problem when I’m debugging an application or testing a mysql database query. They are resetable and it’s so much quicker to select from the database when you’re checking for id=3 or id=25 then id=305678.

The query to reset the auto increment primary id of your choosing is :


ALTER TABLE some_table AUTO_INCREMENT = 1;

It is also possible to set the next auto_increment number
You can do it like this :


SET insert_id=5;

Now your next mysql_insert_id() will be 5.

Share

Mar 1 2009

The Ultimate Idiot’s Guide To Building Your Own Computer

With the complete amateur in mind who has no technical knowledge whatsoever, we are going to show you how to build your own PC! This is a guide where we literally ‘hold your hand’ every step of the way.

Share