[mysql] What is the exact location of MySQL database tables in XAMPP folder?

I have a MySQL database and I want to know the exact location where this data actually stored in the XAMPP folder, I went to this file location to try to get the information:

xampp -> mysql -> data ->

Here I found a separate folder for each of my databases and within these folders I saw files stored with the .frm format (FRM FILE).

When I copied my desired database with all tables in .frm format and try to use them on another PC, I was given an empty database of the same name.

Where are the data files for the database kept on the local server?

This question is related to mysql database data-migration

The answer is


Your database is in this directory:
C:\xampp\mysql\data


For Mac, your database files are located at:

/Applications/XAMPP/xamppfiles/var/mysql

You might need admin permissions to access or delete your files.


The exact location is stored in "my.ini" which exists under main mysql installation directory. In my.ini file, look for 'datadir'. This parameter points the data folder.


In Ubuntu the file path is ./opt/lampp/var/mysql


If you are like me, and manually installed your webserver without using Xampp or some other installer,

Your data is probably stored at C:\ProgramData\MySQL\MySQL Server 5.6\data


Well, here's what worked for me:
Copy and paste the entire data folder, not just the content.
I use xampp, and the path to the data is xampp/mysql/data.

Goodluck!


Data are store in this path. You can search data location, just put the below address in your search location (url address):

C:\xampp\mysql\data


Just in case you forgot or avoided to copy through PHPMYADMIN export feature..

Procedure: You can manually copy: Procedure For MAC OS, for latest versions of XAMPP

Location : Find the database folders here /Users/XXXXUSER/XAMPP/xamppfiles/var/mysql..

Solution: Copy the entire folder with database names into your new xampp in similar folder.

Hope it helps, happy coding.


Rather late I know, but you can use SELECT @@datadir to get the information.

Happy file huntin' SO community :)

Here's how it looks like when ran via phpmyadmin: enter image description here


Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to database

Implement specialization in ER diagram phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' cannot be loaded Room - Schema export directory is not provided to the annotation processor so we cannot export the schema SQL Query Where Date = Today Minus 7 Days MySQL Error: : 'Access denied for user 'root'@'localhost' SQL Server date format yyyymmdd How to create a foreign key in phpmyadmin WooCommerce: Finding the products in database TypeError: tuple indices must be integers, not str

Examples related to data-migration

What is the exact location of MySQL database tables in XAMPP folder? How to move Jenkins from one PC to another SQL Server String or binary data would be truncated How do I move a redis database from one server to another? How to group by week in MySQL? Exporting data In SQL Server as INSERT INTO