S
S
Sectorrbs2021-09-20 22:14:12
MySQL
Sectorrbs, 2021-09-20 22:14:12

Why does the program complain about creating a foreign key?

Faced an inexplicable problem yet
. I create tables in DBForge, and faced such an error when creating foreign keys .
6148dd211a0db246107946.png
Moreover, I create keys in different ways
6148dd38004f8952589563.png
6148dd3d9ff20182571690.png
6148dd438e2e3635183649.png

. I am studying and this needs to be done as part of a course project

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2021-09-20
@galaxy

Show definitions of other tables.
And there could be several reasons:

  • parent tables/columns do not exist
  • column types in child/parent are different
  • parent column has no uniqueness constraint (KEY/UNIQUE)
  • MyISAM engine (hehe)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question