getting error on foreign key

mmernes posted 4 years ago in General
every time I try to add a foreign key get error
create table employee
employeeID int not null auto_increment primary key,
name varchar(80),
job varchar(15),
departmentID int not null references department(departmentID)
) type=InnoDB;

sql(1046) SYNTAX error,it does not like InnoDB
can anyone help please?
ansgar posted 4 years ago
What's the exact error message? There is surely more than "Syntax error".
mmernes posted 4 years ago
you have an error in sql syntax check the manual that corresponds to your mysql server versiĆ³n for the right syntax to use near type=InnoDB at line 7
kalvaro posted 4 years ago
The TYPE keyword was deprecated since MySQL/4.0.18 and was removed in MySQL/5.1.
kalvaro posted 4 years ago
From 4.x manual:

The ENGINE and TYPE options specify the storage engine for the table. ENGINE was added in MySQL 4.0.18 (for 4.0) and 4.1.2 (for 4.1). It is the preferred option name as of those versions, and TYPE has become deprecated. TYPE is supported throughout the 4.x series, but likely will be removed in the future.

I suppose you're generating the code manually rather than reporting an issue with HeidiSQL table editor.

Please login to leave a reply, or register at first.