MySQL 数据库表在 XAMPP 文件夹中的确切位置是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9652949/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 12:28:19  来源:igfitidea点击:

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

mysqldatabasedata-migration

提问by Arif

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:

我有一个 MySQL 数据库,我想知道这些数据实际存储在 XAMPP 文件夹中的确切位置,我去这个文件位置尝试获取信息:

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).

在这里,我为我的每个数据库找到了一个单独的文件夹,在这些文件夹中,我看到了以.frm format (FRM FILE).

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

当我复制我想要的包含所有表的数据库.frm format并尝试在另一台 PC 上使用它们时,我得到了一个同名的空数据库。

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

数据库的数据文件保存在本地服务器上的什么地方?

采纳答案by Mohammad Saberi

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

我认为问题在于您的表格引擎。我猜你正在为你的表使用 InnoDB。所以你不能轻易复制文件来制作副本。
看看这些链接:
http: //dev.mysql.com/doc/refman/5.0/en/innodb-backup.html
http://dev.mysql.com/doc/refman/5.0/en/innodb-迁移.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.

此外,我建议您使用 phpMyAdmin 之类的工具来创建备份文件,然后使用相同的 IDE 在下一台机器上恢复备份文件。

回答by Alfonse

For Mac, your database files are located at:

对于 Mac,您的数据库文件位于:

/Applications/XAMPP/xamppfiles/var/mysql

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

您可能需要管理员权限才能访问或删除您的文件。

回答by Shaktisinh Jadeja

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

您的数据库位于此目录中:
C:\xampp\mysql\data

回答by Can O' Spam

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

我知道的比较晚,但您可以使用它SELECT @@datadir来获取信息。

Happy file huntin' SO community :)

快乐的文件搜索 SO 社区 :)

回答by Sudhir Bastakoti

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.

确切位置存储在mysql主安装目录下的“ my.ini”中。在 my.ini 文件中,查找“datadir”。该参数指向数据文件夹。

回答by Vivek Kumar

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

数据存储在此路径中。您可以搜索数据位置,只需在您的搜索位置(url地址)中输入以下地址:

C:\xampp\mysql\data

C:\xampp\mysql\data

回答by Silva

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.

嗯,这对我有用:
复制并粘贴整个数据文件夹,而不仅仅是内容。
我用的是xampp,数据的路径是xampp/mysql/data.

Goodluck!

祝你好运!

回答by NadZ

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

以防万一您忘记或避免通过 PHPMYADMIN 导出功能复制..

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

程序:您可以手动复制:程序对于 MAC OS,对于最新版本的 XAMPP

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

位置:在此处找到数据库文件夹 /Users/XXXXUSER/XAMPP/xamppfiles/var/mysql..

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

解决方案:将带有数据库名称的整个文件夹复制到类似文件夹中的新 xampp 中。

Hope it helps, happy coding.

希望它有帮助,快乐编码。

回答by Pequenaweb

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

如果您像我一样,在不使用 Xampp 或其他安装程序的情况下手动安装了您的网络服务器,

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

您的数据可能存储在 C:\ProgramData\MySQL\MySQL Server 5.6\data