try

alter table fixtures change id id int auto_increment

Notice that the two references to "id" are intentional!

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 2:44 PM
Subject: using ALTER TABLE to make existing column AUTO_INCREMENT ??


> ive gotten along pretty well with mysql and online docs.  but now i
> am stumped and hoping for a little kick in the right direction.
>
> i have a column in a table which is the primary key and is an int.
> how do i make it also be auto_increment?  the table already has some
> data in it, so i suspect that this may be where my problem comes from.
> when i use ALTER TABLE (my best guess at how to do it), i get this error:
>
>   mysql> alter table fixtures modify column id int auto_increment;
>   ERROR 1062: Duplicate entry '1' for key 1
>
> perhaps i need to somehow start things up with the next highest
> auto increment  .. or ...?
>
>
> thanks,
> -jon
>
> ---------------------------------------------------------------------
> 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