MySQL: What is the main role of .frm file?

What is the role format file (.frm file) ?

FRM stands for FoRMat and it is storing data dictionary information for tables in .frm files. It describes the table’s format like: table definition, including fields and structure. The name of this file is same as the table name.

Specially InnoDB engine stores encoded information about the table and managing its own data dictionary inside the tablespace.

When MySQL drops a table or a database, it also deletes .frm file which is associated with it.

We can also take backup of .frm file, restore the table definition from .frm file, can move .frm file from one storage to another storage.

The .frm file associated with table can be found in the directory that represents the database to which the table belongs.

You can check the MySQL data directory using below SHOW command.

Important Note:
There is also one limitation of .frm file structure.
The portion of the information stored in the .frm file that is checked against the expression cannot grow beyond the 64KB limit, so if the table definition reaches this size, no more columns can be added.

Anvesh Patel

Leave a Reply

2 Comments on "MySQL: What is the main role of .frm file?"

Notify of
Sort by:   newest | oldest | most voted
Harikrishna Guggilla

Hi Bro,

It is structure or description of table format or definition file for INNODB and MYISAM like “.frm” only or it is has to be for every engine i mean FEDERATED,MEMORY,CSV,BLACKHOLE,ARCHIVE and MERGE……?