For an 对于在每个表空间或常规表空间的文件中创建的InnoDB
table created in a file-per-table tablespace or general tablespace, table data and associated indexes are stored in a .ibd file in the database directory. InnoDB
表,表数据和相关索引存储在数据库目录中的.ibd
文件中。When an 在系统表空间中创建InnoDB
table is created in the system tablespace, table data and indexes are stored in the ibdata* files that represent the system tablespace. InnoDB
表时,表数据和索引存储在表示系统表空间的ibdata*
文件中。The 默认情况下,innodb_file_per_table
option controls whether tables are created in file-per-table tablespaces or the system tablespace, by default. innodb_file_per_table
选项控制是在file-per-table表空间还是在系统表空间中创建表。The 无论TABLESPACE
option can be used to place a table in a file-per-table tablespace, general tablespace, or the system tablespace, regardless of the innodb_file_per_table
setting.innodb_file_per_table
设置如何,TABLESPACE
选项可用于将表放置在每个表空间的文件、常规表空间或系统表空间中。
For 对于MyISAM
tables, the storage engine creates data and index files. MyISAM
表,存储引擎创建数据和索引文件。Thus, for each 因此,对于每个MyISAM
table tbl_name
, there are two disk files.MyISAM
表tbl_name
,都有两个磁盘文件。
| Data file |
| Index file |
Chapter 16, Alternative Storage Engines, describes what files each storage engine creates to represent tables. 第16章,“替代存储引擎”描述了每个存储引擎创建哪些文件来表示表。If a table name contains special characters, the names for the table files contain encoded versions of those characters as described in Section 9.2.4, “Mapping of Identifiers to File Names”.如果表名包含特殊字符,则表文件的名称包含这些字符的编码版本,如第9.2.4节,“标识符到文件名的映射”所述。