I created a table in MySQL with on column itemID
.
After creating the table, now I want to change this column to AUTOINCREMENT
.
How can this be done using ALTER statements?
Table definition:
ALLITEMS (itemid int(10) unsigned, itemname varchar(50))
I am using the following code but it is throwing a syntax error
Error: syntax incorrect.
ALTER TABLE allitems
MODIFY itemid INT(10) UNSIGNED AUTOINCREMENT;
See Question&Answers more detail:os