MySQL Forums
Forum List  »  InnoDB

Error doing Create Table with Auto_Increment row
Posted by: Dave Shaffer
Date: March 11, 2013 03:04PM

I am attempting to create a table with an auto_increment row as the last row of a primary key. It works for a primanry key with two rows but this key has three rows. I am using MySQL 5.5.16 on a local Windows PC. The database engine was installed as part of an XAMPP Lite install. I am using phpMyAdmin Import.

Any help would be appreciated.
Thank You

Here is the error:

CREATETABLEIFNOTEXISTS`mafp_training_sessions` (

`ts_org` smallint( 6)NOTNULL ,
`ts_course_no` int( 11)NOTNULL ,
`ts_session` tinyint( 4)NOTNULLAUTO_INCREMENT ,
`ts_display_seq` tinyint( 4)NOTNULL ,
`ts_description` varchar( 500)NOTNULL ,
`ts_hours` decimal( 4, 1)NOTNULL DEFAULT'0.0',
PRIMARYKEY (`ts_org` ,`ts_course_no` ,`ts_session`)
) ENGINE= InnoDBDEFAULT CHARSET= latin1;



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

Options: ReplyQuote


Subject
Views
Written By
Posted
Error doing Create Table with Auto_Increment row
1484
March 11, 2013 03:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.