problem with auto increment field

General usage of Access to MySQL

Moderator: jr

Post Reply
aloist
Posts: 2
Joined: Thu Oct 23, 2008 1:20 pm

problem with auto increment field

Post by aloist »

I try to convert an MS access (2000) database to mysql 5.2

This table definition gets created in the dump file:
CREATE TABLE `tblCategory` (
`CategoryID` INTEGER NOT NULL AUTO_INCREMENT,
`DatamainID` INTEGER,
`CodeID` INTEGER,
`CategoryNotes` VARCHAR(255)
) TYPE=MyISAM;

When I run this dump file with
mysql < dumpfile
I get this error:
Incorrect table definition; there can be only one auto column and it must be defined as a key

I do not understand this mysql error message, because only one column is defined as 'auto'.

Does anyone know what is wrong in the create table statement?
aloist
Posts: 2
Joined: Thu Oct 23, 2008 1:20 pm

Re: problem with auto increment field

Post by aloist »

I found the solution myself.

I need to add a line into the table definition after the AUTO_INCREMENT column:
primary key (column name),

Maybe the developers of 'Access to Mysql' should add this fix to the program.

Access to Mysql is great software, by the way. Simple to use and does exactly what one expects it to do.
Many thanks for making it available.
Post Reply