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

207,102

Solution 1

I think the matter is your tables engine. I guess you are using InnoDB for your table. So you can not copy files easily to make a copy.
Take a look at these links:
http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html
http://dev.mysql.com/doc/refman/5.0/en/innodb-migration.html

Also I recommend you to use something like phpMyAdmin for creating your backup file and then restore the backup file on the next machine using the same IDE.

Solution 2

For Mac, your database files are located at:

/Applications/XAMPP/xamppfiles/var/mysql

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

Solution 3

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

Solution 4

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

Happy file huntin' SO community :)

This is how it looks when ran in phpmyadmin: enter image description here

Solution 5

Copy and paste the entire data folder, not just the content.
I use xampp, and the path to the data is xampp/mysql/data.

Share:
207,102
Arif
Author by

Arif

Updated on November 19, 2021

Comments

  • Arif
    Arif over 2 years

    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?

  • Arif
    Arif about 12 years
    @muhammad thanks alot for answering, ya m using innodb but i try myisam also. I know phpMyAdmin & i import & export data easily but now i need to know the location for my tables
  • Arif
    Arif about 12 years
    ya i saw folder path from "my.ini" but in that folder i found my tables in ".frm" type
  • Mohammad Saberi
    Mohammad Saberi about 12 years
    @Arif all tables stores in the path you said in your question (mysql\data). But when your InnoDB tables and databases have other related files that do not store in this directory. You need .idb files too that I could not find them in this path
  • Arif
    Arif about 12 years
    @Muhammad i have all tables saved in ".frm" type and in same folder there is 1 additional file "db.opt"
  • Mohammad Saberi
    Mohammad Saberi about 12 years
  • Enamul Hassan
    Enamul Hassan almost 8 years
    could you please make your answer more constructive?
  • Chaminda Bandara
    Chaminda Bandara about 7 years
    @Silva There is no directory or file call data in my xampp at centos 6
  • Kalpesh Popat
    Kalpesh Popat over 6 years
    Neat and clean answer
  • auspicious99
    auspicious99 over 5 years
    Still true in 2018 for XAMPP for OS X 7.2.12 (same location)
  • SherylHohman
    SherylHohman about 5 years
    Where do I type this?
  • Filomat
    Filomat over 4 years
    my.ini is in 'C:\xampp\mysql\bin\my.ini' dir
  • Vincent Edward Gedaria Binua
    Vincent Edward Gedaria Binua over 3 years
    @SherylHohman, you can run it via the command line or through phpmyadmin > sql tab.
  • Archit Gargi
    Archit Gargi about 2 years
    I didn't find the data in that place...