Today in MySQL, we add foreign keys to A table, the type is int, the name is not wrong, I temporarily want to add foreign keys to Table A table B, that is, the foreign keys in table A are associated with the primary key in table B.
NavigateSQL, however, always saves an operation with an error:
Foreign key fails with error error Code: 1452. Cannot add or update a child row: a Foreign key constraint fails: XXX.< result 2…
NavigateSQL, however, always saves an operation with an error:
Foreign key fails with error error Code: 1452. Cannot add or update a child row: a Foreign key constraint fails: XXX.< result 2…
Go through Google and solve from StackOverflow!
The original B table I created temporarily had no data. When I added data to B table, I reported the same error again.
Originally, table A associated table B primary key field value, and table B value inconsistent, I manually changed the consistent “content consistent” can be!
StachOverflow:
http://stackoverflow.com/questions/7354032/foreign-key-fails-with-error-error-code-1452-cannot-add-or-update-a-child-row
Record here for accumulation!
Read More:
- Mysql error 1452 – Cannot add or update a child row: a foreign key constraint fails
- MySQL error: can’t create table ‘..’( errno:150 )Solutions
- MySQL failed to add foreign key error 1452
- MySQL failed to add foreign key: SQL 1452 cannot add or update a child row:a foreign key constraint fails
- MySQL error 1451 23000 foreign key exception handling
- Solution of duplicate entry ‘value’ for key ‘field name’ in MySQL
- MySQL error: 1005 can’t create table (error: 150)
- MySql ERROR CODE:1215 Cannot add the foreign key constraint
- javax.persistence.EntityNotFoundException : unable to find error
- MYSQL ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
- Modification method of starting value of MySQL auto increment ID
- Mysql error when deleting the table structure: Error Code: 1217. Cannot delete or update a parent row: a foreign key constraint fails
- MySQL partitions the existing tables of the data table
- mysql ERROR 1025 (HY000): Error on rename of
- Failed to add the foreign key constraint. Missing index for constraint ‘stu_ibfk_1’ in the reference
- 1822 – Failed to add the foreign key constraint. Missing index for constraint ‘tb_emp_ibfk_1’ in the
- About error 1005 (HY000) in MySQL: can’t create table ‘_______ ‘(errno: 150) fool’s plan
- Solution to error 1452: cannot add or update a child row: a foreign key constraint failures in MySQL
- ADB:INSTALL_ FAILED_ UPDATE_ Incompatible [solved]
- code is 143 Container exited with a non-zero exit code 143