MySQL data file introduction and storage location

Source: Internet
Author: User

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

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.