Friday, May 13, 2005

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

If in Mysql get the message "ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key" when trying to drop a primary key, then do the following:

(let's say the table is 'your_table' and the primary key column w/ auto_increment is 'the_column'):

alter table your_table change the_column the_column int unsigned;

to remove the auto_increment, then do a:

alter table your_table drop primary key;

7 comments:

Anonymous said...

Thanks for the tip!

Diaz said...

thanks for this!

A said...

thanks for this!

Anonymous said...

Grateful for that.
=)

rahul said...
This comment has been removed by a blog administrator.
Anonymous said...

This is a great help, thanks

Unknown said...

great help, thanks.