mysql - How to update a database that has foreign keys constraints? -


i have 1 virtual machine (vm_a) runs 1 mysql database db_a schema 200 rows in tbl_1. in virtual machine (vm_b) runs copy of same db_a schema have 50 rows in tbl_1.

i update db_b data db_a.

the tbl_2 holds foreign key tbl_1.

i've made mysql dump db_a run in db_b, updated.

i not want use drop schema, before drop tbl_1.

if try run code in db_b have error caused foreign key constarint in tbl_2.

what best approach update db_b in scenario? have tested solution not worked https://dba.stackexchange.com/questions/40046/is-there-a-way-to-truncate-table-that-has-foreign-a-key

https://dba.stackexchange.com/questions/40046/is-there-a-way-to-truncate-table-that-has-foreign-a-key ms sql-server. in mysql modify session variables

set foreign_key_checks=0; 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -