My Oracle Support Banner

Foreign Keys with Non-Alphanumeric Characters in the Database or Table Name Blocks All Inserts and Updates in Child Table: Cannot Add or Update a Child Row: a Foreign Key Constraint Fails (Doc ID 2011308.1)

Last updated on MARCH 08, 2017

Applies to:

MySQL Server - Version 5.6 to 5.7 [Release 5.6 to 5.7]
Information in this document applies to any platform.


When attempting to insert into a table with a foreign key constraint referencing a table with a non-alphanumeric character in the database or table name, the following error occurs:

  • The foreign key was added with an ALTER TABLE statement.
  • The foreign key was added with @@foreign_key_checks = 0.
  • Cause

    To view full details, sign in with your My Oracle Support account.

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

    In this Document

    This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
    My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.