Jump to content

ALTER TABLE error


daver1982

Recommended Posts

hi

 

this is a mysql question for version 5.1 .

 

im working through a book and i am trying to add a auto_increment column id to an already existing table called "classics".

 

here is the command i am given to enter:

 

ALTER TABLE classics ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT KEY;

 

the response i get is:

 

Error 1064(42000): you have an error in your SQL syntax; check the manual thatcorresponds to your MySQLserver version for the right syntax to use near 'UNASIGNED NOT NULL AUTO_INCREMENT KEY' at line 1.

 

i have looked to see if i have to alter the syntax at all and connot find it. I also tried deleting and using CREATE to make them all at the same time but come up with a similar result.

 

if anyone can shed any light on how i need to alter my commands for the version i have i would be very grateful

 

many thanks in advance

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/172794-alter-table-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.