MySQL foreign key Association

Source: Internet
Author: User
Let's continue to look at the depth of the book recommended by the instructor for mysql database development. When we see the foreign key association problem in the innodb database, we have encountered a problem where we can write to the parent table

Let's continue to look at the depth of the book recommended by the instructor for mysql database development. When we see the foreign key association problem in the innodb database, we have encountered a problem where we can write to the parent table

Let's continue to look at the depth of the mysql database development book recommended by the instructor (for download). We encountered a problem when we saw the foreign key association problem with the innodb database, in the book, you can modify the parent table and synchronize it to the foreign key of the sub-Table. However, you cannot perform this experiment.

  • ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails ('test/city ', CONSTRAINT 'city _ ibfk_1 'eign KEY ('country _ id') REFERENCES 'country' ('country _ id '))
  • The problem above is that the country_id field cannot be changed because of association.

    ,

    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.