MySQL Windows 7中mysql服务器的默认数据文件夹在哪里

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2105843/
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 15:02:35  来源:igfitidea点击:

where is mysql server's default data folder in windows 7

mysqlwindows

提问by nit

I am looking for the data directory of mysql server (5.1.42) I installed on my machine which runs win7.

我正在寻找安装在运行 win7 的机器上的 mysql 服务器 (5.1.42) 的数据目录。

There is no 'data' direcotory in C:\Program Files\MySQL\MySQL Server 5.1 and also in C:\Users\MyAccount\AppData\Local||LocalLow||Roaming

C:\Program Files\MySQL\MySQL Server 5.1 和 C:\Users\MyAccount\AppData\Local||LocalLow||Roaming 中没有“数据”目录

回答by Cris

Different MySQL/Windows versions have different data folder locations. To get your ACTUAL data folder location just execute this SQL:

不同的 MySQL/Windows 版本有不同的数据文件夹位置。要获取您的 ACTUAL 数据文件夹位置,只需执行以下 SQL:

SHOW VARIABLES WHERE Variable_name LIKE '%dir'

回答by Vladislav Vaintroub

Must be C:\ProgramData\MySQL\MySQL Server 5.1\data.

必须是 C:\ProgramData\MySQL\MySQL Server 5.1\data。

Was not really a good idea to place data here by default. It is compatible with various Vista compatibility requirements, but is eather hard to find, especially given the ProgramData folder is hidden.

默认情况下将数据放在这里并不是一个好主意。它兼容各种 Vista 兼容性要求,但很难找到,尤其是在 ProgramData 文件夹被隐藏的情况下。

回答by Noman

You can find the data directory at this location C:\ProgramData\MySQL\MySQL Server 5.5\data\<YourDataDirectory\TableName.frm>

您可以在此位置找到数据目录 C:\ProgramData\MySQL\MySQL Server 5.5\data\<YourDataDirectory\TableName.frm>

回答by Michal ?iha?

The path can be defined in my.ini(located in Windows directory) as datadir.

路径可以在my.ini(位于 Windows 目录中)定义为datadir.

回答by Martin

I have had the problem to find the data directory too and even to start the mysql the second time after installing the server 5.7 on Windows 7.

我也遇到了找到数据目录的问题,甚至在 Windows 7 上安装服务器 5.7 后第二次启动 mysql。

In contrary to some answers here and to the documentation (the part about location of my.ini), the my.ini location was c:\ProgramData\MySQL\MySQL Server 5.7\my.ini the data location was c:\ProgramData\MySQL\MySQL Server 5.7\Data. In fact it was to see, as default proposed data location, during the installation.

与此处的某些答案和文档(有关 my.ini 位置的部分)相反,my.ini 位置为 c:\ProgramData\MySQL\MySQL Server 5.7\my.ini 数据位置为 c:\ProgramData\ MySQL\MySQL 服务器 5.7\Data。事实上,它是在安装过程中看到的,作为默认建议的数据位置。

回答by Aleks Vidmantas

If you installed mysql with the MSI installer, look here: C:\ProgramData\MySQL\MySQL Server 5.7\and you should see the data folder. Even thought my datadiris specified to be located in the default mysql serverlocation, my data is stored in %ProgramData%.

如果您使用 MSI 安装程序安装了 mysql,请查看此处:C:\ProgramData\MySQL\MySQL Server 5.7\您应该会看到数据文件夹。即使认为 mydatadir指定位于默认mysql server位置,我的数据也存储在%ProgramData%.

回答by Guillermo

This is what worked for me on Windows 7:

这就是在 Windows 7 上对我有用的方法:

c:\ProgramData\MySQL\MySql Server 5.7> xcopy data c:\MySQL\"MySQL Server 5.7"\data\

After that, run MySQL server with:

之后,使用以下命令运行 MySQL 服务器:

c:\MySQL\"MySQL Server 5.7"\bin> mysqld

Thanks to those who shared the information that C:\ProgramDatawas a hidden directory!

感谢那些分享C:\ProgramData隐藏目录信息的人!

回答by zgormez

Windows version independent answer.

Windows 版本独立的答案。

For MySQL 5.7on Windows, directory for log files and databases is

对于MySQL 5.7Windows,日志文件和数据库的目录是

"%PROGRAMDATA%\MySQL\MySQL Server 5.7\"

"%PROGRAMDATA%\MySQL\MySQL Server 5.7\"

The Windows system variable %PROGRAMDATA%defaults to C:\ProgramData

Windows 系统变量 %PROGRAMDATA%默认为C:\ProgramData

source:https://dev.mysql.com/doc/refman/5.7/en/windows-installation-layout.html

来源:https : //dev.mysql.com/doc/refman/5.7/en/windows-installation-layout.html

回答by M. Kahlani

After changing the directory, the root password is reset. So, keep in mind, if you change the directory, and have access issues, try to access it without a password then set a new password.

更改目录后,将重置 root 密码。因此,请记住,如果您更改目录并遇到访问问题,请尝试在没有密码的情况下访问它,然后设置新密码。

回答by user2530225

Take a look at:

看一眼:

C:\Users\All Users\MySQL\MySQL Server 5.1\data

C:\用户\所有用户\MySQL\MySQL Server 5.1\data