Re: Anyway to reset MySql's AUTO_INCREMENT counter?
| From: | David Robley | Date: | Thu, 26 Jul 2001 08:53:11 +0000 |
| Subject: | Re: Anyway to reset MySql's AUTO_INCREMENT counter? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59708@lists.php.net to get a copy of this message | ||
On Thu, 26 Jul 2001 19:13, elias wrote:
> Hi.
>
> Usually, Any AUTO_INCREMENT field in MySql table will have always an
> incrementing value.
> Now Suppose I emptied the table and then inserted one record, why not
> this record LAST_INSERT_ID is not '1' or '0' and why it is the lastid+1
> before I empty the table?
>
> Can't I reset that pointer w/ deleting the table and creating it again?
This is the php list, not the mysql list :-)
Again from the mysql manual (you should get a copy)
If you delete the row containing the maximum value for an AUTO_INCREMENT
column, the value will be reused with an ISAM, GEMINI or BDB table but
not with a MyISAM or InnoDB table. If you delete all rows in the table
with DELETE FROM table_name (without a WHERE) in AUTOCOMMIT mode, the
sequence starts over for all table types.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
You look like something the cat refused to drag in.