Home  >  Article  >  Database  >  清空具有外键约束的表时报ERROR 1701(42000)的解决_MySQL

清空具有外键约束的表时报ERROR 1701(42000)的解决_MySQL

WBOY
WBOYOriginal
2016-06-01 13:36:191217browse

bitsCN.com


清空具有外键约束的表时报ERROR 1701(42000)的解决

 

   ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key
constraint (`furion`.`tbl_frn_alert`, CONSTRAINT `FK353A3CBEB139CC08`
FOREIGN KEY (`endpt_id`) REFERENCES `furion`.`tbl_frn_endpt` (`id`))

解决方法:

 

mysql> SET foreign_key_checks=0;

 

 删除后

 

mysql> SET foreign_key_checks=1;

 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn