mysql truncate 当表有外键引用时候,报错

  |   0 评论   |   0 浏览

清空具有外键约束的表时报ERROR 1701(42000)的解决
 
   ERROR 1701 (42000): Cannot truncate a table referenced in a foreign keyconstraint (furion.tbl_frn_alert, CONSTRAINT FK353A3CBEB139CC08FOREIGN KEY (endpt_id) REFERENCES furion.tbl_frn_endpt (id))
  www.2cto.com  
解决方法:
 
SET foreign_key_checks=0;
 
 删除后
 
mysql> SET foreign_key_checks=1;


标题:mysql truncate 当表有外键引用时候,报错
作者:码农路上
地址:http://wujingjian.club/articles/2019/06/18/1560855827098.html