There are approaches when the foreign key table cleared mysql

 

The case can ignore the associated:

Cancel the primary foreign key relationships verify: SET FOREIGN_KEY_CHECKS = 0;

Then remove the need to remove the data: truncate table table_name;

The last restoration: SET FOREIGN_KEY_CHECKS = 1;

Guess you like

Origin www.cnblogs.com/chenjw-note/p/11419231.html