Jump to content

Installing an auto-increment field in an existing table in phpMyAdmin


iainlang

Recommended Posts

I've searched the Knowledge Base but couldn't find anything which answered my question.

 

I have an auto-increment id field in my tables which (for reasons of displaying the unsigned zerofill in limited screen space) I want to replace with a new auto-increment id field which will, of course, start again at 0.

 

In phpMyAdmin, I delete the existing auto-increment id field and, when trying to install a new one, I get -

 

"ALTER TABLE `help` ADD `id` SMALLINT( 2 ) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT FIRST

 

MySQL said: 

#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key  "

 

I expect it's something terribly simple and I'm just being stupid.

 

Can anyone help, please?

Link to comment
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.