problem with auto increment field

General usage of Access to MySQL

Moderator: jr

problem with auto increment field

Postby aloist » Thu Oct 23, 2008 1:26 pm

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

Postby aloist » Thu Oct 23, 2008 1:35 pm

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.
aloist
 
Posts: 2
Joined: Thu Oct 23, 2008 1:20 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron