MySQL Data File introduction and storage location, mysql data storage location
How can I view the storage location of MySql database physical files?
Use the command line to search:
Show global variables like '% datadir % ';
I am searching for the following locations: C: \ ProgramData \ MySQL Server 5.7 \ Data \
Modify the default storage location:
In the C: \ ProgramData \ MySQL Server 5.7 \ my. ini
Press ctrl + f to search for "datadir" to find the physical path of your database. Modify it here:
1. database files created and managed by MySQL (server:
. 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