MySQL foreign key constraint disable and enable commands

MySQL foreign key constraint disable and enable commands

Disabling and enabling MySQL foreign key constraints:

Whether MySQL foreign key constraints are enabled is indicated by a global variable:

FOREIGN_KEY_CHECKS=0; Disabled

FOREIGN_KEY_CHECKS=1; Enabled

To view the current value of FOREIGN_KEY_CHECKS, use the following command:

SELECT @@FOREIGN_KEY_CHECKS;

Disable foreign key constraints:

SET FOREIGN_KEY_CHECKS=0;

Enable foreign key constraints:

SET FOREIGN_KEY_CHECKS=1;

The above disabling and enabling commands of MySQL foreign key constraints are all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Example explanation of MySQL foreign key constraints
  • Detailed explanation of MySQL foreign key constraints
  • Examples of common operations on MySQL foreign key constraints [view, add, modify, delete]
  • Introduction to MySQL method of deleting table data with foreign key constraints
  • Simple implementation of ignoring foreign key constraints when deleting MySQL tables
  • How to disable foreign key constraint checking in MySQL child tables
  • Detailed explanation of foreign key constraints in MySQL
  • Detailed explanation of creating a data table in MySQL and establishing primary and foreign key relationships
  • MySQL and Oracle data type correspondence (tabular form)
  • Summary of MySQL foreign key constraints and table relationships

<<:  Example steps for implementing class selectors and name attribute selectors in js

>>:  How to disable foreign key constraint checking in MySQL child tables

Recommend

Introduction to general_log log knowledge points in MySQL

The following operation demonstrations are all ba...

Let's learn about JavaScript object-oriented

Table of contents JavaScript prototype chain Obje...

Detailed explanation of the background-position percentage principle

When I was helping someone adjust the code today,...

Briefly understand the two common methods of creating files in Linux terminal

We all know that we can use the mkdir command to ...

How to install and use Server-U 14 version

Introducing Server-U software Server-U is a very ...

Tutorial on how to modify the root password in MySQL 5.7

Version update, the password field in the origina...

Learn to deploy microservices with docker in ten minutes

Since its release in 2013, Docker has been widely...

Native js to realize a simple snake game

This article shares the specific code of js to im...

Introduction to installing JDK under Linux, including uninstalling OpenJDK

1. View openjdk rpm -qa|grep jdk 2. Delete openjd...

Four solutions for using setTimeout in JS for loop

Table of contents Overview Solution 1: Closures S...

Specific use of stacking context in CSS

Preface Under the influence of some CSS interacti...

KTL tool realizes the method of synchronizing data from MySQL to MySQL

Use ktl tool to synchronize data from mysql to my...

How to generate Hive table creation statement comment script in MySQL metadata

Preface This article mainly introduces the releva...

Vue commonly used high-order functions and comprehensive examples

1. Commonly used high-order functions of arrays S...