Make sure your tables are using InnoDB Storage engine and then try:
ALTER TABLE `ORDERS` ADD FOREIGN KEY(`CUSTOMER_NUM`) REFERENCES `CUSTOMER`(`CUSTOMER_NUM`);
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
When you create a table, you need to specify the engine - ex:
CREATE TABLE `dbName`.`tableName` (
...
)
ENGINE = INNODB
CHARACTER SET utf8 COLLATE utf8_general_ci;
By default, it is MyIsam. As a matter of fact, line 7 of your post CLEARLY shows that MyISAM IS the default engine on your db server.
Your post simply confirms that your DB "supports" InnoDB IF you choose to use it on your tables, but you have to specify which engine to use on the tables. If you don't it will assume you meant MyISAM, which does NOT support constraints.
All the tables involved in the relationship constraints will need the InnoDB storage engine.
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244