I'm learning how to copy columns and I'm having a little trouble.
The column that I'm trying to copy is from the same database. Correct
me if I am wrong, but I think you have to create the column in the
database first? Here is the command that I'm using, but its not
working, obviously.
mysql> alter table bugs add column test mediumint(9) NOT NULL
auto_increment;
ERROR 1075 (42000): Incorrect table definition; there can be only one
auto column and it must be defined as a key
Here is the table that has the column that I'm trying to copy from:
mysql> describe bugs \G
*************** ************ 1. row *************** ************
Field: bug_id
Type: mediumint(9)
Null:
Key: PRI
Default: NULL
Extra: auto_increment
Can somebody give me a clue. Also, I'm looking for detailed
documentation on primary keys, if somebody has such a link, please send
it to me, thanks in advance.
usaims
The column that I'm trying to copy is from the same database. Correct
me if I am wrong, but I think you have to create the column in the
database first? Here is the command that I'm using, but its not
working, obviously.
mysql> alter table bugs add column test mediumint(9) NOT NULL
auto_increment;
ERROR 1075 (42000): Incorrect table definition; there can be only one
auto column and it must be defined as a key
Here is the table that has the column that I'm trying to copy from:
mysql> describe bugs \G
*************** ************ 1. row *************** ************
Field: bug_id
Type: mediumint(9)
Null:
Key: PRI
Default: NULL
Extra: auto_increment
Can somebody give me a clue. Also, I'm looking for detailed
documentation on primary keys, if somebody has such a link, please send
it to me, thanks in advance.
usaims
Comment