disable foreign key constraint mysql code example
Example 1: foreign key set 0
SET FOREIGN_KEY_CHECKS=0;
Example 2: mariadb disable foreign key checks
SET FOREIGN_KEY_CHECKS=0;
Example 3: mysql remove foreign key constraint
ALTER TABLE jobs DROP FOREIGN KEY constraint_name
Example 4: drop all foreign key constraints mysql
SET foreign_key_checks = 0;
Example 5: Mysql Drop Foreign key
ALTER TABLE Orders
ADD CONSTRAINT FK_PersonOrder
FOREIGN KEY (PersonID)
REFERENCES Persons(PersonID);