A file containing the metadata Read.FRM file, such as the table definition, of a MySQL table.
For backups, you must always keep the full set of Read.frm
files along with the backup data to be able to restore tables that are altered or dropped after the backup.
Although each InnoDB
table has a Read.frm
file, InnoDB
maintains its own table metadata in the system tablespace.
.frm
files are backed up by the MySQL Enterprise Backup product. These files must not be modified by an ALTER TABLE
operation while the backup is taking place, which is why backups that include non-InnoDB
tables perform an FLUSH TABLES WITH READ LOCK
operation to freeze such activity while backing up .frm
files. Restoring a backup can result in .frm
files being created, changed, or removed to match the state of the database at the time of the backup.
A file containing the metadata, such as the table definition, of a MySQL table. .frm
files were removed in MySQL 8.0 but are still used in earlier MySQL releases. In MySQL 8.0, data previously stored in .frm
files is stored in data dictionary tables.
Read blog:
The following list briefly describes the main implications of this change:
.frm
metadata files previously associated with base tables and views no longer exist. Metadata previously stored in Read.frm
files is now stored in data dictionary tables.Similarly, trigger metadata previously stored in .TRG
and .TRN
files are stored in a data dictionary table and those files no longer exist..frm
files, the 64KB table definition size limit imposed by the .frm
file structure is removed..frm
files, the INFORMATION_SCHEMA.TABLES
VERSION
the field now reports a hardcoded value of, which is the last .frm
file version used in MySQL 5.7..frm
files, the sync_frm
system variable is removed.CREATE TRIGGER
and DROP TRIGGER
operations are combined into a single, atomic transaction.INFORMATION_SCHEMA
tables that can be queried instead. This enables the underlying data dictionary tables to be changed as server development proceeds while maintaining a stable INFORMATION_SCHEMA
interface for application use.Some INFORMATION_SCHEMA
tables have been reimplemented entirely as views on data dictionary tables:CHARACTER_SETS COLLATIONS COLLATION_CHARACTER_SET_APPLICABILITY COLUMNS KEY_COLUMN_USAGE SCHEMATA STATISTICS TABLES TABLE_CONSTRAINTS VIEWS
Queries on those tables are now more efficient because they obtain information from data dictionary tables rather than by other, slower means. In particular, for each INFORMATION_SCHEMA
table that is a view of data dictionary tables:INFORMATION_SCHEMA
table..frm
files), INFORMATION_SCHEMA
queries for those values now use table lookups instead. (Additionally, even for a non-view INFORMATION_SCHEMA
table values such as database and table names are retrieved by lookups from the data dictionary and do not require a directory or file scans.)INFORMATION_SCHEMA
table using a temporary table per query.SHOW
statements that display information corresponding to the INFORMATION_SCHEMA
tables that are viewed on data dictionary tables. For example, SHOW DATABASES
displays the same information as the SCHEMATA
table.For INFORMATION_SCHEMA
queries that retrieve table statistics, the server now can use statistics cached in INFORMATION_SCHEMA
tables, or obtain the latest statistics directly from storage engines. The information_schema_stats
system variable controls which statistics source the server uses.
information_schema_stats
is CACHED
(the default), the server uses cached statistics stored in the STATISTICS
and TABLES
tables.information_schema_stats
is LATEST
, the server obtains statistics directly from storage engines. In this case, the server treats queries on STATISTICS
and TABLES
as queries for the latest statistics stored in the STATISTICS_DYNAMIC
and TABLES_DYNAMIC
tables.Affected INFORMATION_SCHEMA
table statistic columns include: