文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 28 个 INFORMATION_SCHEMA 表 / 28.4 INFORMATION_SCHEMA InnoDB 表 / 28.4.13 INFORMATION_SCHEMA INNODB_FOREIGN_COLS 表
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 75%

28.4.13 INFORMATION_SCHEMA INNODB_FOREIGN_COLS 表28.4.13 The INFORMATION_SCHEMA INNODB_FOREIGN_COLS Table

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 as INNODB_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 the PROCESS privilege to query this table.

  • 使用 INFORMATION_SCHEMA COLUMNS 表或 SHOW COLUMNS 语句查看关于此表列的更多信息,包括数据类型和默认值。Use the INFORMATION_SCHEMA COLUMNS table or the SHOW COLUMNS statement to view additional information about the columns of this table, including data types and default values.