Error 1452 MySQL

后端 未结 1 760
时光说笑
时光说笑 2021-01-22 06:26

Inserting data into an empty table, but got error 1452. I am not sure why MySQL mentions the NameInfo table within the error.

CREATE TABLE NameInfo (
Language V         


        
相关标签:
1条回答
  • 2021-01-22 07:32

    Error 1452 indicates an insertion failed because a foreign key constraint couldn't be honoured.

    Your query is inserting data into the Employee table, which has a foreign key constraint referring to the Departments table. If you haven't got a Department entry set up that the Employeee row refers to the insertion will fail.

    You need to insert the Departments entries first, or your Employee insertions will fail this test.

    0 讨论(0)
提交回复
热议问题