Mani's Blog

September 26, 2011

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

Filed under: MySQL — mani @ 6:20 pm

I was dropping primary key which I don’t want.  I got the following error.

alter table invitation_migration drop primary key;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

Error can be skipped by:  alter table <table_name> drop primary key, ADD PRIMARY KEY (‘diff_column_from_table’);

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: