MYSQL fails to create a foreign key. The record Can't create table cannot be created.

Source: Internet
Author: User

You cannot create one. the error of the frm file seems to imply an error in the file permission of the operating system or other reasons, but in fact, none of these are actually. In fact, this mysql error has been reported as a mysql bug and has been found in the mysql developer list for many years. However, this seems misleading.

In many instances, this error occurs because mysql has never been able to support the problem, unfortunately, it does not specify which problem will lead to the above error. Below I will list the common causes of this terrible 150 error, in addition, I sorted the possibility by size. The reason is:

1. the type or size of two fields are not strictly matched. For example, if one field is INT (10), the foreign key must be set to INT (10) instead of INT (11) it cannot be TINYINT. you must use the SHOW command to check the field size, because some query browsers sometimes display both int (10) and int (11) as integer. In addition, you must determine whether one of the two fields is SIGNED and the other is UNSIGNED. The two fields must be exactly consistent,

Related Article

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.