How can I see where my MySQL database physical files are stored?
To find using the command line:
Show global variables like '%datadir% ';
I find the location:C:\ProgramData\MySQL\MySQL Server 5.7\data\
To modify the default saved location:
In C:\ProgramData\MySQL\MySQL Server 5.7\my.ini
Press Ctrl+f to search for "DataDir" to find the physical path of your database, where you can modify it:
1. MySQL (server) created and managed database files:
. frm file: A frame structure that stores data tables with the same file name as the table name, and each table corresponds to a frm file with the same name, regardless of the operating system and the storage engine, regardless of what operating system the MySQL is running on and which storage engine is used.
In addition to the required. frm files, depending on the storage engine used by MySQL (the two storage engines commonly used by MySQL are MyISAM and InnoDB), the storage engine creates separate database files.
2. MyISAM database Table file:
. MyD file: That is my data, the table file
. Myi file: My index, indexed file
. log files: Log files
3. InnoDB uses tablespace (tablespace) to manage data, store table data and indexes,
InnoDB database file (that is, InnoDB file set, Ib-file set):
IBDATA1, IBDATA2, etc.: System tablespace files, storing InnoDB system Information and user database table data and indexes, all tables shared
. ibd Files: Single-table space files, each using a tablespace file (file per table) that holds user database table data and indexes
Log files: Ib_logfile1, Ib_logfile2
MySQL data file introduction and storage location