MySQL Data File introduction and storage location, mysql data storage location

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.