Cannot truncate a table referenced in a foreign key constraint

SET foreign_key_checks=0;
TRUNCATE TABLE newstitle;
SET foreign_key_checks=1;
TRUNCATE TABLE newstext;
select * from newstitle;
select * from newstext;

SET foreign_key_checks=0
> OK
> 时间: 0s


TRUNCATE TABLE newstitle
> OK
> 时间: 0.259s


SET foreign_key_checks=1
> OK
> 时间: 0s
posted @ 2019-07-23 14:18  Philtell  阅读(212)  评论(0编辑  收藏  举报