Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.4Mb
PDF (A4) - 37.4Mb
PDF (RPM) - 33.0Mb
HTML Download (TGZ) - 8.2Mb
HTML Download (Zip) - 8.2Mb
HTML Download (RPM) - 7.1Mb
Man Pages (TGZ) - 129.9Kb
Man Pages (Zip) - 185.5Kb
Info (Gzip) - 3.3Mb
Info (Zip) - 3.3Mb

MySQL 8.0 Reference Manual  /  ...  /  The INFORMATION_SCHEMA INNODB_FOREIGN Table

Pre-General Availability Draft: 2018-03-23


The INNODB_FOREIGN table provides metadata about InnoDB foreign keys.

For related usage information and examples, see Section 15.14.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.

Table 25.20 INNODB_FOREIGN Columns

Column name Description
ID The name (not a numeric value) of the foreign key index. Preceded by the database name, for example, test/products_fk.
FOR_NAME The name of the child table in this foreign key relationship.
REF_NAME The name of the parent table in this foreign key relationship.
N_COLS The number of columns in the foreign key index.
TYPE A collection of bit flags with information about the foreign key column, ORed together. 1 = ON DELETE CASCADE, 2 = ON UPDATE SET NULL, 4 = ON UPDATE CASCADE, 8 = ON UPDATE SET NULL, 16 = ON DELETE NO ACTION, 32 = ON UPDATE NO ACTION.


*************************** 1. row ***************************
      ID: test/fk1
FOR_NAME: test/child
REF_NAME: test/parent
  N_COLS: 1
    TYPE: 1


  • Use DESCRIBE or SHOW COLUMNS to view additional information about the columns of this table including data types and default values.

  • You must have the PROCESS privilege to query this table.

User Comments
Sign Up Login You must be logged in to post a comment.