Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Databases»MariaDB»How to Temporarily Disable Foreign Key Checks in MySQL

    How to Temporarily Disable Foreign Key Checks in MySQL

    By RahulNovember 10, 20151 Min Read

    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.

    Advertisement

    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.

    mariadb MySQL
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    (Resolved) MySQL connection error: certificate verify failed

    How to Connect Python with MySQL Database

    Installing MySQL 8.0 on Amazon Linux 2

    How To Install MySQL 8 on Amazon Linux 2

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.