MySQL Error 1215 / 3780: Cannot add foreign key constraint
Referenced and referencing columns differ in type, signedness, charset, or storage engine.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.0.0
Identifier: MySQL Error 1215 / 3780: Cannot add foreign key constraint
Platform: MySQL / MariaDB
Interactive Diagnostic Checklist
Safe Diagnostic Command:
SHOW ENGINE INNODB STATUS\G
Technical Explanation
Referenced and referencing columns differ in type, signedness, charset, or storage engine. Verified technical resolution: Ensure both columns use InnoDB and identical data types (e.g. both BIGINT UNSIGNED).
Worked Examples
- Diagnostic check: SHOW ENGINE INNODB STATUS\G
Limitations & Assumptions
- Confirm exact software version and execution layer before applying configuration changes in production.
Source References & Verification
Resource ID: err-mysql-1215-cannot-add-fk · Independently verified: 2026-11-25