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 failed to add foreign key: SQL 1452 cannot add or update a child row:a foreign key constraint fails
- Mysql error 1452 – Cannot add or update a child row: a foreign key constraint fails
- MYSQL ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
- Mysql error when deleting the table structure: Error Code: 1217. Cannot delete or update a parent row: a foreign key constraint fails
- MySql ERROR CODE:1215 Cannot add the foreign key constraint
- MySQL error code 1217 (ER_ROW_IS_REFERENCED): Cannot delete or update a parent row: a foreign key co
- MySQL error 1451 23000 foreign key exception handling
- MySQL failed to add foreign key error 1452
- Solution to error 1452: cannot add or update a child row: a foreign key constraint failures in MySQL
- mysql Error Code: 1022. Can’t write; duplicate key in table `xxx`
- Ora-02292: integrity constraint (XX) violated – child record found foreign key Association, record cannot be deleted
- 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
- MySQL: if the remote connection using navicatip fails, prompt “is not allowed to connect to this MySQL server”
- Solution of duplicate entry ‘value’ for key ‘field name’ in MySQL
- [reprint and save] MySQL does not set the primary key and uses the self growing ID method
- The solution of duplicate entry ‘for key’ primary ‘when inserting data in MySQL
- Txt import MySQL: error 1062 (23000): duplicate entry ‘0’ for key ‘primary’
- MySQL Workbench: Error Code: 2013. Lost connection to MySQL server during query solution
- MySql 8.x java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed