Not Able To TRUNCATE TABLE Due To "ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint" (Doc ID 1969005.1)

Last updated on MARCH 14, 2017

Applies to:

MySQL Cluster - Version 7.2 and later
MySQL Server - Version 5.5 and later
Information in this document applies to any platform.

Symptoms

Unable to TRUNCATE TABLE.

After initializing a crashed Data node, some of the tables cannot be truncated:

mysql> truncate table t1;
ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint ()
mysql> truncate table t3;
ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint ()

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms