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

Detailed explanation of three solutions to the website footer sinking effect

Background Many website designs generally consist...

Complete list of CentOS7 firewall operation commands

Table of contents Install: 1. Basic use of firewa...

Use of hasOwnProperty method of js attribute object

Object's hasOwnProperty() method returns a Bo...

Simple web page code used in NetEase blog

How to use the code in NetEase Blog: First log in...

JavaScript using Ckeditor + Ckfinder file upload case detailed explanation

Table of contents 1. Preparation 2. Decompression...

The core process of nodejs processing tcp connection

A few days ago, I exchanged some knowledge about ...

Detailed steps for installing nodejs environment and path configuration in Linux

There are two ways to install nodejs in linux. On...

Detailed explanation of how to use Teleport, a built-in component of Vue3

Table of contents 1. Teleport usage 2. Complete t...

Detailed explanation of Vuex overall case

Table of contents 1. Introduction 2. Advantages 3...

vue3.0+echarts realizes three-dimensional column chart

Preface: Vue3.0 implements echarts three-dimensio...

Summary of JavaScript's setTimeout() usage

Table of contents 1. Introduction 2. The differen...

Solution for forgetting the root password of MySQL5.7 under Windows 8.1

【background】 I encountered a very embarrassing th...

Docker installation tomcat dubbo-admin instance skills

1. Download the tomcat image docker pull tomcat:8...