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

    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