This error often occurs when you try to create a foreign key in mysql, which is very frustrating. 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, and I sorted it by the possibility.
Known causes:
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,