Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.7Mb
PDF (A4) - 37.7Mb
PDF (RPM) - 33.8Mb
HTML Download (TGZ) - 8.4Mb
HTML Download (Zip) - 8.4Mb
HTML Download (RPM) - 7.3Mb
Man Pages (TGZ) - 130.0Kb
Man Pages (Zip) - 185.6Kb
Info (Gzip) - 3.3Mb
Info (Zip) - 3.3Mb


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

Pre-General Availability Draft: 2018-02-22

25.32.21 The INFORMATION_SCHEMA INNODB_FOREIGN_COLS Table

The INNODB_FOREIGN_COLS table provides status information about the columns of InnoDB foreign keys.

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

Table 25.21 INNODB_FOREIGN_COLS Columns

Column nameDescription
IDThe foreign key index associated with this index key field, using the same value as INNODB_FOREIGN.ID.
FOR_COL_NAMEThe name of the associated column in the child table.
REF_COL_NAMEThe name of the associated column in the parent table.
POSThe ordinal position of this key field within the foreign key index, starting from 0.

Example:

mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS WHERE ID = 'test/fk1'\G
*************************** 1. row ***************************
          ID: test/fk1
FOR_COL_NAME: parent_id
REF_COL_NAME: id
         POS: 0

Notes:

  • 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.