INNODB_FOREIGN_COLS 表提供有关 InnoDB 外键列的状态信息。The INNODB_FOREIGN_COLS table
provides status information about InnoDB
foreign key columns.
有关相关的使用信息和示例,请参见 第 17.15.3 节,“InnoDB INFORMATION_SCHEMA 模式对象表”。For related usage information and examples, see Section 17.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
INNODB_FOREIGN_COLS 表具有以下列:The INNODB_FOREIGN_COLS table has
these columns:
ID与此索引键字段关联的外键索引;与
INNODB_FOREIGN.ID的值相同。The foreign key index associated with this index key field; the same value asINNODB_FOREIGN.ID.FOR_COL_NAME子表中关联列的名称。The name of the associated column in the child table.
REF_COL_NAME父表中关联列的名称。The name of the associated column in the parent table.
POS该关键字段在外键索引中的序号位置,从 0 开始。The 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
你必须拥有
PROCESS权限才能查询此表。You must have thePROCESSprivilege to query this table.使用
INFORMATION_SCHEMACOLUMNS表或SHOW COLUMNS语句查看关于此表列的更多信息,包括数据类型和默认值。Use theINFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.