I had this error and I changed my tables column length smaller for the indexed foreign key columns so I changed it like this: VARCHAR(1024) To: VARCHAR(512) And run the query again.