MySQL data file introduction and storage location 1. MySQL database file introduction
Each MySQL database is stored in a folder with the same name as the database. the MySQL database files include the database files created by MySQL and the database files created by the storage engine used by MySQL.
1. database files created and managed by MySQL:
. Frm File: The framework structure of the data table. the file name is the same as the table name. each table corresponds to an frm file of the same name, which is irrelevant to the operating system and storage engine, that is, no matter what operating system MySQL runs on and what storage engine is used, this file is available.
Apart from the necessary. frm files, the storage engine creates different database files based on the storage engine used by MySQL (two storage engines commonly used by MySQL are MyISAM and InnoDB.
2. MyISAM database table file:
. MYD File: MY Data, table Data file
. MYI File: MY Index, Index file
. Log File: log file
3. InnoDB uses tablespace to manage data and store table data and indexes,
InnoDB database file (I .e., InnoDB file set, ib-file set ):
Ibdata1 and ibdata2: System tablespace files that store InnoDB system information and user database table data and indexes. all tables share
. Ibd file: a single table space file. each table uses a single table space file (file per table) to store user database table data and indexes.
Log files: ib_logfile1 and ib_logfile2
II. MySQL database storage location:
1. if MySQL uses the MyISAM storage engine, the database file types include. frm ,. MYD ,. MYI. the default storage location is C:/Documentsand Settings/All Users/Application Data/MySQL Server 5.1/data.
2. if MySQL uses the InnoDB storage engine, the database file types include. frm, ibdata1, and. ibd. There are two storage locations,
. The default storage location of frm files is C:/Documents and Settings/All Users/ApplicationData/MySQL Server 5.1/data, ibdata1 ,. the default storage location of ibd files is the data folder under the MySQL installation directory.
Reference: http://blog.csdn.net/yaotinging/article/details/6671506