Use of MYSQL Foreign Key -- modify (ADD) Foreign Key method, Foreign Key names cannot have repeated

Source: Internet
Author: User

Use of MYSQL Foreign Key -- modify (ADD) Foreign Key method, Foreign Key names cannot have repeated 1. caseNumber in case_detail created in wms today cannot be associated with case_head. An error is prompted several times after the result is created, which takes a long time. Keyword: mysql createtable errno 121 150 error table creation error foreign key 2. the statement for adding a foreign key is [SQL] ALTER TABLE 'setting _ group' ADD CONSTRAINT 'location _ ibfk_2 'FOREIGN KEY ('id ') REFERENCES 'setting _ action' ('id') on delete cascade on update cascade; Note:. the foreign key name cannot be important; B. if the primary key name is incorrect, an error is reported. 3. When modifying the data, you must first clear the data and add it. When data exists internally, the primary key cannot be modified or added.

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.