Working with Tables
 
Table Representation on Memory
 
Every table, no matter its format, is represented on disk by a file that contains the table's format (that is, its definition). This file has a basename that is the same as the table name and a .frm extension.
 
For most table types, a table's contents are stored on disk using other files that are unique to the table. The exceptions are for HEAP and InnoDB tables, for which the .frm file is the only one that is uniquely associated with a given table.
 
(HEAP table contents are stored in memory. InnoDB table contents are managed within the InnoDB tablespace in common with other InnoDB tables, not within files specific to a particular table.) The various table types use files with the following extensions:
 

Table Type

Files on Disk

ISAM

.frm (definition), .ISD (data), .ISM (indexes)

MyISAM

.frm (definition), .MYD (data), .MYI (indexes)

MERGE

.frm (definition), .MRG (list of constituent MyISAM table names)

HEAP

.frm (definition)

BDB

.frm (definition), .db (data and indexes)

InnoDB

.frm (definition)

 
For any given table, the files specific to it are located in the directory that represents the database to which the table belongs.