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

Blog    

Recommend

How to use dd command in Linux without destroying the disk

Whether you're trying to salvage data from a ...

How to use axios to make network requests in React Native

In front-end development, there are many ways to ...

Facebook's nearly perfect redesign of all Internet services

<br />Original source: http://www.a-xuan.cn/...

10 very good CSS skills collection and sharing

Here, clever use of CSS techniques allows you to g...

18 killer JavaScript one-liners

Preface JavaScript continues to grow and prosper ...

Summary of JavaScript's setTimeout() usage

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

CentOS7 uses yum to install mysql 8.0.12

This article shares the detailed steps of install...

Nginx/Httpd load balancing tomcat configuration tutorial

In the previous blog, we talked about using Nginx...

How to manually encapsulate paging components in Vue3.0

This article shares the specific code of the vue3...

Three commonly used MySQL data types

Defining the type of data fields in MySQL is very...

A detailed introduction to the Linux directory structure

When you first start learning Linux, you first ne...

Detailed steps to install MySQL 5.6 X64 version under Linux

environment: 1. CentOS6.5 X64 2.mysql-5.6.34-linu...