Menu

Temporarily Disable Foreign Key Checks in MySQL

You must have faced the foreign key constrains issues many times while working with MySQL database. Generally this issue occurred during delete, insert records, backup and restore database and drop database and drop tables. In this situation its hard to complete task. MySQL provides an option to disable foreign key checks during any operation on tables or databases. You can disable check and complete your task without any issues.

This article will help you to how to enable or disable foreign key check in MySQL. Ever you faced foreign key error, Disable foreign key checks, do you work and enable it again.

Disable Foreign Key Checks

SET FOREIGN_KEY_CHECKS=0;

Enable Foreign Key Checks

SET FOREIGN_KEY_CHECKS=1;
Remember that, do not forgot to re-enable foreign key checks again after doing your work.

About Author:


I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Next
Newer Post
Previous
Older Post

0 comments:

Post a Comment

 
Top