I would suggest you issue an ALTER TABLE command to change your
AUTO_INCREMENT to unsigned.  The concept of AUTO_INCREMENT negates the use
of negative numbers.  If you are using the change from positive to negative
to flag for deletion or some other process, try adding a column for this
purpose and not messing with the AUTO_INCREMENT column.  ALTER TABLE can be
executed on a production database.

I hope this helps...

Pat...

----- Original Message -----
From: "Enea Mansutti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 29, 2001 2:44 AM
Subject: setting autoincrement value help needed (Second post)


> First of all MySQL rocks!!!
>              --------------
> Now for my problem...
> Unfortunately, before I knew how autoincrement worked, I have setup a
database with a signed autoincrement column in a production environment.
> When I insert columns, I usually pass NULL as the column value for the
INSERT statement to correctly insert the next autoincrement value.
> Occasionally (for maintenance reasons) I have to MANUALLY insert values
with negative numbers, this corrupts the autoincrement value (autoincrement
seems to be unsigned) so i have to run myisamchk -A to fix it.
> I wanted to know if there is an sql command i can execute which has the
same effect of myisamchk -A.
> I have tried to use SET INSERT_ID=# but it seems to set the autoincrement
value only for the current connection and for the first insert only.
> Another question, is it safe to run myisamchk -A without shutting down the
mysql in a production environment?
>
> regards,
>
> Enea
>
> ------------------------------
> P.Review srl
> +39 02 29061035
> [EMAIL PROTECTED]
> www.presstoday.com
>
>
> ---------------------------------------------------------------------
> 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
>


---------------------------------------------------------------------
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