Brief description of the storage location of MySQL database files

Source: Internet
Author: User

The following articles mainly describe the MySQL database file and its specific storage location. In actual applications, we often access MySQL database files. What is its main function? And how to store them correctly? The following articles detail these issues.

I. 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: Framework Structure of the data table. The file name of the MySQL database is the same as that of the table. 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.

In addition to the required. frm files, the storage engine creates different database files based on the two storage engines MyISAM and InnoDB used by MySQL.

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 table space to manage data and store table data and indexes,

InnoDB database file is the InnoDB file set, ib-file set ):

Ibdata1, ibdata2, and others: System tablespace MySQL database files, which 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 tablespace file per table), which stores 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: \ Documents ents and Settings \ All Users \ Application Data \ MySQL Server 5.1 \ data.

2. If MySQL uses the InnoDB Storage engine, MySQL database file types include. frm, ibdata1, And. ibd. There are two storage locations,

. The default storage location of frm files is C: \ Documents ents and Settings \ All Users \ Application Data \ MySQL Server 5.1 \ data, ibdata1 ,. the default storage location of ibd files is the data folder under the MySQL installation directory.


The above content is an introduction to MySQL database files and storage locations. I hope you will find some gains.

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.