mysqldude
Error codes › 1701

MySQL & MariaDB error 1701 ER_TRUNCATE_ILLEGAL_FK

MySQLCannot truncate a table referenced in a foreign key constraint (…)
MariaDBCannot … a table referenced in a foreign key constraint (…)
Example from our test runs: Cannot truncate a table referenced in a foreign key constraint (`t_1`.`emp`, CONSTRAINT `emp_ibfk_1`) (8.0.46) · Cannot truncate a table referenced in a foreign key constraint (`t_1`.`emp`, CONSTRAINT `emp_ibfk_1` FOREIGN KEY (`dept_id`) REFERENCES `t_1`.`dept` (`id`)) (10.6.28)
MySQLMariaDB
SymbolER_TRUNCATE_ILLEGAL_FKER_TRUNCATE_ILLEGAL_FK
SQLSTATE4200042000
TypeServer errorServer error
Versionssince 5.5.63 activeevery release since 5.5 active
How the message changed between versions
MariaDB fromSymbolMessage
5.5.68ER_TRUNCATE_ILLEGAL_FKCannot truncate a table referenced in a foreign key constraint (%.192s)
13.2.1ER_TRUNCATE_ILLEGAL_FKCannot %s a table referenced in a foreign key constraint (%.192s)