I saw a lot of same question but I couldn\'t solve my case.
If I run this code:
Tags.id_articls
is a signed integer while Articl.id
is an unsigned integer. MySQL requires referencing field to be exactly the same type. Make Tags.id_articls
unsigned to have it work.
Additionally, the table names in the column lists are not allowed in MySQL. It is always clear which table is meant: first the referencing table and then the referenced table. So change
FOREIGN KEY(Tags.id_articls) REFERENCES Articls(Articls.id)
into
FOREIGN KEY(id_articls) REFERENCES Articls(id)
and it will work.
You need to declare both Articls.id
and Tags.id_articls
signed or unsigned