[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