“Kesalahan MySQL 1215” Kode Jawaban

Kesalahan MySQL 1215

I'm guessing that Clients.Case_Number and/or Staff.Emp_ID are not exactly the same data type as Clients_has_Staff.Clients_Case_Number and Clients_has_Staff.Staff_Emp_ID.

Perhaps the columns in the parent tables are INT UNSIGNED?

They need to be exactly the same data type in both tables.
Santino

Kesalahan MySQL 1215

When you are trying to reference a key on parent table which is not a candidate key (either a primary key or a unique key) you may get the error code: 1215 cannot add foreign key constraint. ... It does not necessarily to be a primary key. MySQL requires index on corresponding referenced key, so you need a unique key
Santino

Jawaban yang mirip dengan “Kesalahan MySQL 1215”

Pertanyaan yang mirip dengan “Kesalahan MySQL 1215”

Lebih banyak jawaban terkait untuk “Kesalahan MySQL 1215” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya