Question : cannot truncate a table referenced in a foreign key constraint
Answered by : amjadkhanroot
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table $table_name;
SET FOREIGN_KEY_CHECKS = 1;
Source : https://stackoverflow.com/questions/5452760/how-to-truncate-a-foreign-key-constrained-table | Last Update : Wed, 21 Oct 20
Question : truncate table mysql
Answered by : thoughtful-trout-5mro3ksnqh44
TRUNCATE [TABLE] table_name;
Source : https://www.mysqltutorial.org/mysql-truncate-table/ | Last Update : Tue, 21 Jun 22
Question : how to force truncate a table in mysql
Answered by : nutty-newt-c8zxvbhgqxz1
DELETE FROM mytest.instance;
ALTER TABLE mytest.instance AUTO_INCREMENT = 1;
Source : | Last Update : Mon, 28 Dec 20