Documentation Home
MySQL Workbench Manual
Related Documentation Download this Manual
PDF (US Ltr) - 17.0Mb
PDF (A4) - 17.0Mb


MySQL Workbench Manual  /  ...  /  Creating Foreign Key Relationships

9.1.4 Creating Foreign Key Relationships

Foreign key constraints are supported for the InnoDB storage engine only. For other storage engines, the foreign key syntax is correctly parsed but not implemented. For more information, see FOREIGN KEY Constraint Differences.

MySQL Workbench enables you to add a foreign key from within the table editor or from within an EER diagram by using the relationship tools on the vertical toolbar. This section describes how to add a foreign key using the foreign key tools. To add a foreign key using the table editor, see Section 8.1.10.4, “Foreign Keys Tab”.

The graphical tools for adding foreign keys are most effective when you are building tables from the ground up. If you have imported a database using an SQL script and need not add columns to your tables, you may find it more effective to define foreign keys using the table editor.