MySQL Database Files

by Vincy. Last modified on June 1st, 2021.

In MySQL database installation, a directory has set of files which contain database metadata and data. That is the database schema and containing values. These files are,

  • .frm – contains schema
  • .myd – contains data
  • .myi – contain indices

All the above list of files may not be available in MySQL database directory. It depends on various criteria like database engine, platform and etc.

For example, if we use MyISAM engine, then data folder will contain all the above files, but for InnoDB, it contains only .frm files.

MySQL Directory Files Location

  • Data folder path is set in MySQL configuration file
  • MySQL configuration file in Windows is my.ini and Linux is my.cnf


C:\Program Files\MySQL\MySQL Server 5.2\my.ini

Open my.ini and search for word “basedir”

  • basedir – gives the location of MySQL installation
  • datadir – gives the location of MySQL data directory
#Path to installation directory
basedir="C:/Program Files/MySQL/MySQL Server 5.2/"
#Path to the database root
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.2/Data/"

In that path, there is separate folder for each database with the name of the database itself. Database files can be used for backup to secure data, schema, and indices in general circumstances, migration and DB upgrade.

Comments to “MySQL Database Files”

Leave a Reply

Your email address will not be published. Required fields are marked *

↑ Back to Top