Mysql use the delete key constraint by external impact when drop truncate solutions delete data

Disable the foreign key constraint database:

  set foreign_key_checks=0;

Delete operation

  delete、drop、truncate

Database restore foreign key constraint:

  set foreign_key_checks=1;

Guess you like

Origin www.cnblogs.com/jiangxishicheng/p/10968292.html
Recommended