Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.