I assume that you have already found a solution, since this post is six months old, but I recently had to come up with a script to dump foreign key constraints into a specific table in MySQL so that this could help someone else in the same boat:
To start it just use:
SET @schema = 'schema_name'; CALL DropConstraints(@schema, 'TableName', 'Referenced_Column_1'); CALL DropConstraints(@schema, 'TableName', 'Referenced_Column_2');
And if you do not want to support the procedure around:
DROP PROCEDURE DropConstraints;
Of course, if you want to remove all FK constraints in the table, you can remove the refcolumn parameter and the last line of each where clause.
Sean the bean
source share