Digital Marketing

DROP all foreign keys in MYSQL.sql

SELECT 
CONCAT('ALTER TABLE ',
TABLE_NAME,
' DROP FOREIGN KEY ',
CONSTRAINT_NAME,
';')
FROM
information_schema.key_column_usage
WHERE
CONSTRAINT_SCHEMA = 'db_name'
AND referenced_table_name IS NOT NULL;

Comments

Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership