Can't set foreign key relationship

I know this is old but the usual culprits are Non Null flag and Unsigned. Make sure you do match these on the foreign key column if the referenced column does have them enabled.


I had the same problem.. then I have checked the two tables.. The issue was the type, it should be matched in both two tables.

if in foralda table column id_familjer is (INT)
in fkblixten table column id_familjer also should be be (INT). if the two data types are not matching MySQL Workbench won't allow to select the column as foreign key.


It can be also because of different collations. Just check if those 2 columns have the same collation.

In my case one was with

Table default (using utf8 general)

the other one with

utf8_unicode_ci

I have set those 2 columns with utf8_unicode_ci and it works.