Not the answer you need?
Register and ask your own question!

MySQL replication process breaks

aleksej.lopasovaleksej.lopasov EntrantCurrent User Role Beginner
Hi,I have an issue in master-slave replication process.
I have made a database copy from master with xtrabackup and prepared it on slave. Then I configured a replication. But every time it breaks (err 1452) while executing one query:

Error 'Cannot add or update a child row: a foreign key constraint fails (`db_name`.`table1_name`, CONSTRAINT `fk_name` FOREIGN KEY (`product_id`) REFERENCES `table2_name` (`id`) ON DELETE)' on query. Default database: 'db_name'. Query: 'INSERT IGNORE INTO table_name (`product_id`, `fitment_id`) VALUES ('345824756', '2346278');

I tried to execute this query straight in mysql console and everything worked. It doesn't matter is foreign-key-check 0 or 1. Query works in console but doesn't work, when comes via replication process.
Are there any idea why is that?

Master mysql version 5.6.24-72.2
Slave mysql version 5.6.27-75.0
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.