MySQL data storage method

1. If table b uses the InnoDB engine, 1 or 2 files will be generated in data\a:
b.frm: file describing the table structure, field length, etc.
If the system table space mode is used, the data information and index information are stored in In ibdata1
By default, InnoDB will create a file named ibdata1 with a size of 12M in the data directory. This file is the representation of the corresponding system table space on the file system.
Note that this file is a self-expanding file, and it will increase the file size when there is not enough .
If you want the system table space to correspond to multiple actual files on the file system, or you just think the original ibdata1 file name is
ugly, you can configure the corresponding file paths and their sizes when MySQL starts. For example, let's modify my. cnf configuration
file:

[server]
innodb_data_file_path=data1:512M;data2:512M:autoextend

If the independent table space storage mode is adopted, the b.ibd file will also be generated in data\a (to store data information and index information).
In addition:
① In MySQL5.7, the db.opt file will be generated in the data/a directory for storage. Database related configuration. For example: character set, comparison
rules. MySQL8.0 no longer provides the db.opt file.
② b.frm is no longer provided separately in MySQL8.0, but is merged into the b.ibd file.

2. If table b uses MyISAM, 3 files will be generated in data\a:
In MySQL5.7: b.frm: file describing the table structure, field length, etc.
In MySQL8.0, b.xxx.sdi: describes the table structure file, field length, etc.
b.MYD (MYData): data information file, stores data information (if independent table storage mode is used)
b.MYI (MYIndex): stores index information document

Guess you like

Origin blog.csdn.net/shenBaoYun/article/details/125664603