Hi

I am no pro with Mysql, but had similar results when first starting out. My
understanding is that the Auto Increment value is held in a file other than
the actual data file, so when it uses the auto-increment it is not reading
the last value from the actual DB and then adding one, but rather looking in
'another file' and using the 'control' record. Therefore when creating the
table the control record is set to one, if you specify a auto-increment
number when importing data, the mysql handler does not goto the 'control'
record and add one, because you specified a value. If you do not specify a
value, then the handler WILL go the 'control' record and add one.

a simple test is

1. create a test table

2. insert a record specifying your auto-increment value as 1

3. try inserting a record without specifying a auto-increment value, the
first one may/may not work, but the second will definatelly not (sometimes
if I remember correctly the first number may be 0, so the second one will be
1.)

in my plain language there it is, but the pro's may give a more detailed
approach.

Regards
Warren

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Warren van der Merwe
Software Director
PRT Trading (Pty) Ltd t/a RedTie
Durban, South Africa
Cell (+27-83) 262-9163
Office (+27-31) 767-0249


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> ]On Behalf
> Of Alexander Skwar
> Sent: 17 July 2001 21:58
> To: [EMAIL PROTECTED]
> Subject: mysqldump loses auto_increment
>
>
> Hello.
>
> I've just created a table with a auto_increment column.  I then did
>
> ALTER TABLE tbl AUTO_INCREMENT=4711;
>
> Now, when I insert one row into this table, it get's 4711 as the
> auto_increment column's value.  However, dumping this table with
>
>  mysqldump --opt DB tbl
>
> loses the auto_increment value i set.  So, if I'd replay the dump, the
> first time I insert a row it would get 1 for the
> auto_increment, and not
> 4711.
>
> How to circumvent this?
>
> Alexander Skwar
> --
> How to quote: http://learn.to/quote (german)
> http://quote.6x.to (english)
> Homepage:     http://www.digitalprojects.com   |
> http://www.iso-top.de
>    iso-top.de - Die günstige Art an Linux Distributionen zu kommen
>               Uptime: 13 hours 25 minutes
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to