mysqldude
Error codes › 1822

MySQL & MariaDB error 1822 ER_FK_NO_INDEX_PARENT

Error messageFailed to add the foreign key constraint. Missing index for constraint '…' in the referenced table '…'
Example from our test runs: Failed to add the foreign key constraint. Missing index for constraint 'c2_ibfk_1' in the referenced table 'p2' (8.0.46)
MySQLMariaDB
SymbolER_FK_NO_INDEX_PARENTER_FK_NO_INDEX_PARENT
SQLSTATEHY000HY000
TypeServer errorServer error
Versionssince 5.6.51 activesince 10.0.38 active
How the message changed between versions
MySQL fromSymbolMessage
5.6.51ER_FK_NO_INDEX_PARENTFailed to add the foreign key constaint. Missing index for constraint '%s' in the referenced table '%s'
8.0.16ER_FK_NO_INDEX_PARENTFailed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'
MariaDB fromSymbolMessage
10.0.38ER_FK_NO_INDEX_PARENTFailed to add the foreign key constaint. Missing index for constraint '%s' in the referenced table '%s'
10.4.34ER_FK_NO_INDEX_PARENTFailed to add the foreign key constraint. Missing index for constraint '%s' in the referenced table '%s'