MYSql cannot establish foreign key constraints. environment: mysql + MySQLQueryBrowser table structure: & nbsp; table t: t1int primary key auto-increment & nbsp; t2int default value: 1 & nbsp; table tt: tt1int primary key auto-increment & nbsp; tt2int & nbsp; now I want to create a MYSql in the tt table. the foreign key constraint cannot be created.
Environment: mysql + MySQL Query Browser
Table structure:
Table t: t1 int primary key automatically increases
T2 int default value = 1
Table tt: tt1 int primary key automatically increases
Tt2 int
Now we want to create a foreign key constraint in the tt table, t. t1 = tt. tt2,
However, the error 1005 or 1208 is always prompted when MySQL Query Browser is created.
On. UPdate on delete I selected cascade UPdate and delete.
The fields are also matched, but why not.
Ask for advice.
------ Solution --------------------
Does your table type use innodb? If myisam does not support foreign keys.
------ Solution --------------------
Only InnoDB supports foreign key constraints.