Foreign key constraints during mysql Data Import

Source: Internet
Author: User
When you import data, a foreign key error is often reported. This is because the table has foreign key constraints, but the data imported may not be complete yet, so this error occurs. This problem can be solved through FOREIGN_KEY_CHECKS. Its usage is as follows: setFOREIGN_KEY_CHECKS0; # Set it to not check the foreign key constraints before import .... # Import

When you import data, a foreign key error is often reported. This is because the table has foreign key constraints, but the data imported may not be complete yet, so this error occurs. This problem can be solved through FOREIGN_KEY_CHECKS. The usage is as follows: set FOREIGN_KEY_CHECKS = 0; # set it to not check the foreign key constraints before import .... # Import

When you import data, a foreign key error is often reported. This is because the table has foreign key constraints, but the data imported may not be complete yet, so this error occurs.



This problem can be solved by FOREIGN_KEY_CHECKS. The usage is as follows:


Set FOREIGN_KEY_CHECKS = 0; # set to not check foreign key constraints before import .... # Import data set FOREIGN_KEY_CHECKS = 1; # restore check for foreign key constraints after import



[Article Title] foreign key constraints during mysql Data Import
[Author] Zeng jiansheng
[Author mailbox] zengjiansheng1@126.com
[Author's QQ] 190678908
[Author's blog] blog.csdn.net/newjueqi


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.