Problem with foreign keys
The error is that you're trying to use a constraint that is already identified.

SELECT
   constraint_name,
   table_name
FROM
   information_schema.table_constraints
WHERE
   constraint_type = 'FOREIGN KEY'
AND table_schema = DATABASE()
ORDER BY
   constraint_name;


Should give you the constraints you've already established. Also, you can use SHOW ENGINE INNODB STATUS or SHOW INNODB STATUS after you get the error to get the logs and more information.