I needed to load some lookup data into a MySQL database littered with foreign keys. So I copied the empty DB and ran the output of the following:
SELECT CONCAT('alter table ',table_schema,'.',table_name,' DROP FOREIGN KEY ',constraint_name,';')
FROM information_schema.table_constraints
WHERE constraint_type='FOREIGN KEY' AND table_schema = 'MY_DATABASE_NAME_HERE'; \
[Read More]