本文介绍了MySQL在Windows上将数据库文件存储在哪里,文件的名称是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我不小心格式化了硬盘驱动器,重新安装了Windows,却忘记了备份MySQL服务器中的重要数据库.我正在尝试使用某些软件来抢救文件,但我不知道要寻找什么.

So I accidentally formatted my hard drive and re-installed Windows and forgot to backup an important database I had in my MySQL server. I'm trying to salvage files now using some software, but I don't know what to look for.

文件存储的路径是什么,文件的名称是什么(我应该使用什么命名约定或文件扩展名)?

What is the path that the files are stored in, and what are the files named (what naming convention, or file extension should I look for)?

我相信我的服务器使用的是MyISAM,但不是100%确定.

I believe my server was using MyISAM, but not 100% sure.

任何建议将不胜感激!

推荐答案

您可以检查my.ini文件以查看数据文件夹的位置.

You can check my.ini file to see where the data folder is located.

通常有一个文件夹{mysqlDirectory}/data

Usually there is a folder {mysqlDirectory}/data

MySQL数据存储:

MySQL data storage:

Commands.frm
Commands.myd
Commands.myi

*.frm文件包含表定义.您的* .myi文件是MyISAM索引文件.您的* .myd文件包含表数据.

The *.frm files contain the table definitions. Your *.myi files are MyISAM index files. Your *.myd files contain the table data.

编辑/更新.由于问题中显示的兴趣,此处提供了更多信息,该信息也可以在评论中找到.

Edit/Update.Because of the interest shown in the question here is more info which is found also in the comments.

在Windows 8.1中,默认情况下,MySQL数据库存储在以下位置:C:\ProgramData\MySQL\MySQL Server 5.6\data

In Windows 8.1, the MySQL databases are stored (by default) here: C:\ProgramData\MySQL\MySQL Server 5.6\data

文件夹C:\ ProgramData是一个隐藏文件夹,因此必须将其键入Windows资源管理器地址才能到达.在该数据文件夹中,数据库被命名为/{database_name_folder}/{database_tables_and_files}.

The folder C:\ProgramData is a hidden folder, so you must type it into Windows Explorer address to get there. In that data folder, the databases are named /{database_name_folder}/{database_tables_and_files}.

例如

C:\ProgramData\MySQL\MySQL Server 5.6\data\mydatabase\mytable.frm
C:\ProgramData\MySQL\MySQL Server 5.6\data\mydatabase\mytable.ibd

感谢@ marty-mcgee此内容

Thank @marty-mcgee for this content

这篇关于MySQL在Windows上将数据库文件存储在哪里,文件的名称是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 14:34