MySQL represents each table by an .frm
table format (definition) file in the database directory. The
storage engine for the table might create other files as well.
For InnoDB tables, the file storage is
controlled by the
innodb_file_per_table
configuration option. For each InnoDB table
created when this option is turned on, the table data and all
associated indexes are stored in a
.ibd file located inside
the database directory. When this option is turned off, all
InnoDB tables and indexes are stored in the
system tablespace,
represented by one or more
ibdata* files.
For MyISAM tables, the storage engine creates
data and index files. Thus, for each MyISAM
table tbl_name, there are three disk
files.
| File | Purpose |
|---|---|
| Table format (definition) file |
| Data file |
| Index file |
Chapter 15, Alternative Storage Engines, describes what files each storage engine creates to represent tables. 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.3, “Mapping of Identifiers to File Names”.