I looked it up online and found four reasons:
1. The reference types of foreign keys are different. The primary key is int and the foreign key is char
. 2. The column referenced in the main table cannot be found.
3. The character encoding of the primary key and the foreign key is inconsistent
. Build an index. There is also an error without indexing
Then I looked at my database and found that the error was because the foreign key associated with the slave table was not the primary key.