Mysqlcreatetableerrno121150 error table creation error foreign key _ MySQL

Source: Internet
Author: User
[Switch] mysqlcreatetableerrno121150 error table creation error foreign key Mysql foreign key

BitsCN.com

Mysql createtable errno 121 150 error table creation error foreign key


Both of these errors are caused by foreign keys involved in table creation.



Error Code: 1005

Can't create table 'apts. dd_flight '(errno: 121)



Foreign keys and tables are the same. duplicate names with other foreign keys are not allowed in the same database.

If this error occurs, change the foreign key you have defined to a unique name without duplicates.





ERROR 1005: Can't create table (errno: 150)



This error is caused by inconsistent definitions of the foreign key association fields of the master table and the referenced table.

Check whether the associated fields of the two tables are fully consistent in type encoding.



Another possibility is that the joined field does not have an index in the referenced table. you must create an index for the joined field in the referenced table.

BitsCN.com

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.