問題
truncate xx
時,提示cannot truncate a table refrenenced in a foreign key constraint
解決
You can do truncate by skipping foreign key checks.
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table1;
SET FOREIGN_KEY_CHECKS = 1;
truncate xx
時,提示cannot truncate a table refrenenced in a foreign key constraint
You can do truncate by skipping foreign key checks.
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table1;
SET FOREIGN_KEY_CHECKS = 1;