I have to create a database with two tables in MySQL, but the script fails with errno 150 (foreign key problem). I double-checked the foreign key fields to be the same on bo
Another hint:
Even when your data types seem to be the same - in my case both columns had VARCHAR(50) - this is not enough.
VARCHAR(50)
You also need to make sure that both columns have the same COLLATION.
COLLATION