When creating a reference constraint in mysql, the error message MySQL error 1005: can’t create table (errno: 150) will appear. As a result, the reference constraint cannot be created
General situation of the problem:
The reference types of foreign keys are different. For example, the primary key is int and the foreign key is char
The column referenced in the main table could not be found
The character encoding of primary key and foreign key is inconsistent, and the storage engine may be different
Similar Posts:
- [Solved] MYSQL add foreign key error: Referencing column ‘xx’ and referenced column ‘xx’ in foreign key constraint ‘xxx’ are incompatible.
- [Solved] MYSQL Error: Cannot delete or update a parent row: a foreign key constraint fails
- MYSQL ERROR 1005 (HY000): Can’t create table [How to Solve]
- [Solved] MYSQL Error when deleting a table: Cannot delete or update a parent row: a foreign key constraint fails
- [Solved] cannot load from mysql.proc. the table is probably corrupted
- MySQL Error Number 1005 Can’t create table (Errno:150)
- used in key specification without a key length
- mysql: [Err] 1075 – Incorrect table definition; there can be only one auto column and it must be d…
- [Solved] MySQL uses the workbench tool, and the table status is read only
- MySQL: invisible empty symbol char (9) char (10) char (13)