MySQL my.ini 位置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14597884/
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
MySQL my.ini location
提问by Sap
I have already seen http://dev.mysql.com/doc/refman/4.1/en/mysql-config-wizard-file-location.html
我已经看过 http://dev.mysql.com/doc/refman/4.1/en/mysql-config-wizard-file-location.html
how to know mysql my.cnf location
and
和
http://dev.mysql.com/doc/refman/5.1/en/option-files.html
http://dev.mysql.com/doc/refman/5.1/en/option-files.html
But I am still stuck with the ages old question!
"Where is my my.ini"
I am using windows server 2008 with mysql 5.5.28. I installed the service using mysqld --install and I am able to use the mysql server using sqlyog. But unfortunately I am not able to find my.ini in installation directory
or not in c:\
neither in c:\windows
nor in data_dir
query show variables like "mysql_home"
returned nothing as well.
但我仍然被这个古老的问题所困扰!“我的 my.ini 在哪里” 我使用的是带有 mysql 5.5.28 的 Windows Server 2008。我使用 mysqld --install 安装了该服务,并且能够使用 sqlyog 使用 mysql 服务器。但不幸的是,我无法找到的my.ini在installation directory
或不在c:\
既不c:\windows
也不在data_dir
查询show variables like "mysql_home"
返回什么为好。
Any suggestions?
有什么建议?
采纳答案by RolandoMySQLDBA
You have to look I the folder C:\Program Files\MySQL\MySQL Server 5.5
but there is a problem. When you perform an MSI install of MySQL, my.ini is not created. There will be sample .ini files in that folder. In order to use one of them, say my-medium.ini
, you need to do the following before a MySQL restart:
您必须查看文件夹,C:\Program Files\MySQL\MySQL Server 5.5
但有问题。当您执行 MySQL 的 MSI 安装时,不会创建 my.ini。该文件夹中将有示例 .ini 文件。为了使用其中之一,例如my-medium.ini
,您需要在 MySQL 重新启动之前执行以下操作:
cd C:\Program Files\MySQL\MySQL Server 5.5
copy my-medium.ini my.ini
net stop mysql
net start mysql
Once, you do this, my.ini
can be read by C:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe
.
一旦,你这样做,my.ini
可以被读取C:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe
。
回答by amateur barista
my.ini LOCATION ON WINDOWS MYSQL 5.6 MSI (USING THE INSTALL WIZARD)
my.ini 在 WINDOWS MYSQL 5.6 MSI 上的位置(使用安装向导)
Open a Windows command shell and type: echo %PROGRAMDATA%
. On Windows Vista this results in: C:\ProgramData
.
打开 Windows 命令外壳并键入:echo %PROGRAMDATA%
. 在 Windows Vista 上,这会导致:C:\ProgramData
.
According to http://dev.mysql.com/doc/refman/5.6/en/option-files.html, the first location MySQL will look under is in %PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini
. In your Windows shell if you do ls "%PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini"
, you will see that the file is there.
根据http://dev.mysql.com/doc/refman/5.6/en/option-files.html,MySQL 将查看的第一个位置在%PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini
. 在你的 Windows shell 中,如果你这样做ls "%PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini"
,你会看到文件在那里。
Unlike most suggestions you will find in Stackoverflow and around the web, putting the file in C:\Program Files\MySQL\MySQL Server 5.6\my.ini
WILL NOT WORK. Neither will C:\Program Files (x86)\MySQL\MySQL Server 5.1
.The reason being quoted on the MySQL link posted above:
与您会在 Stackoverflow 和网络中找到的大多数建议不同,将文件放入C:\Program Files\MySQL\MySQL Server 5.6\my.ini
将不起作用。也不会C:\Program Files (x86)\MySQL\MySQL Server 5.1
。在上面发布的 MySQL 链接上引用的原因:
On Windows, MySQL programs read startup options from the following files, in the specified order (top items are used first).
在 Windows 上,MySQL 程序以指定的顺序从以下文件中读取启动选项(首先使用顶部项目)。
The 5.6 MSI installer doescreate a my.ini in the highestpriority location, meaning no other file will ever be found/used, except for the one created by the installer.
5.6 MSI 安装程序会在最高优先级的位置创建一个 my.ini ,这意味着除了安装程序创建的文件外,不会找到/使用其他文件。
The solution accepted above will not work for 5.6 MSI-based installs.
上面接受的解决方案不适用于基于 5.6 MSI 的安装。
回答by Bae Cheol Shin
- Enter "services.msc" on the Start menu search box.
- Find MySQL service under Name column, for example, MySQL56.
- Right click on MySQL service, and select Properties menu.
- Look for "Path To Executable" under General tab, and there is your .ini file, for instance, "C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MYSQL56
- 在开始菜单搜索框中输入“services.msc”。
- 在 Name 列下找到 MySQL 服务,例如 MySQL56。
- 右键单击 MySQL 服务,然后选择“属性”菜单。
- 在 General 选项卡下查找“Path To Executable”,有你的 .ini 文件,例如,“C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin\mysqld.exe” --defaults-file= "C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MYSQL56
回答by Mangue Sutcliff
I've found mine in
我找到了我的
\ProgramData\MySQL\MySQL Server 8.0\
(It is a hidden folder)
(这是一个隐藏文件夹)
You can type win+R
and write %PROGRAMDATA%
to access that folder, or just enable show hidden folder.
您可以键入win+R
和写入%PROGRAMDATA%
以访问该文件夹,或仅启用显示隐藏文件夹。
回答by Chirael
Start MySQL Workbench, then Server -> Options File and look at bottom of the window; it will say something like "Configuration File: C:\ProgramData\MySQL\MySQL Server 5.6\my.ini"
启动 MySQL Workbench,然后 Server -> Options File 并查看窗口底部;它会说类似“配置文件:C:\ProgramData\MySQL\MySQL Server 5.6\my.ini”
(And note the subtle difference between "ProgramData" and "Program Files" - easy to gloss over if you're looking for a quick answer.)
(并注意“ProgramData”和“Program Files”之间的细微差别 - 如果您正在寻找快速答案,则很容易掩盖。)
回答by anubhs
You can find the my.ini file in windows at this location- C:\ProgramData\MySQL\MySQL Server 5.6
你可以在 windows 中的这个位置找到 my.ini 文件 - C:\ProgramData\MySQL\MySQL Server 5.6
the ProgramData folder is a hidden folder, so make the according setting to see that folder. And open my.ini file as an administrator to edit and then save that.
ProgramData 文件夹是一个隐藏文件夹,因此请进行相应设置以查看该文件夹。并以管理员身份打开 my.ini 文件进行编辑,然后保存。
回答by Rahul Dave
In my case, the folder ProgramData
was hidden by default on windows 7, so I was unable to find my.ini
file.
就我而言,该文件夹ProgramData
在 Windows 7 上默认是隐藏的,因此我无法找到my.ini
文件。
After selecting show hidden files and folders option, I was able to find the my.ini
file at the location: C:\ProgramData\MySQL\MySQL Server 5.6
.
选择显示隐藏文件和文件夹选项后,我能够my.ini
在以下位置找到该文件:C:\ProgramData\MySQL\MySQL Server 5.6
.
Display hidden files and folders on windows 7:
在 Windows 7 上显示隐藏的文件和文件夹:
Right-click the Windows Logo button and choose Open Windows Explorer.
Click Organize and choose Folder and Search Options.
Click the View tab, select Show hidden files and folders and then clear the checkbox for Hide protected system operating files.
Click Yes on the warning and then click OK.
右键单击 Windows 徽标按钮并选择打开 Windows 资源管理器。
单击“组织”并选择“文件夹和搜索选项”。
单击“查看”选项卡,选择“显示隐藏的文件和文件夹”,然后清除“隐藏受保护的系统操作文件”复选框。
在警告上单击是,然后单击确定。
回答by Raul
it is there at C:\Program Files\MySQL\MySQL Server 5.5 there are various .ini files with small, medium & large names. generally medium is used or it depends on your requirement.
它位于 C:\Program Files\MySQL\MySQL Server 5.5 中,有各种小、中、大名称的 .ini 文件。通常使用介质或取决于您的要求。
回答by Pavan Gilda
programData
is hidden folder so you have to change the option from setting to show hidden folder and then make the change in my.ini
file present in that.
programData
是隐藏文件夹,因此您必须将选项从设置更改为显示隐藏文件夹,然后更改其中存在的my.ini
文件。
Be sure to update the correct my.ini
file because it can waste a lot of your time if you keep updating wrong file.
请务必更新正确的my.ini
文件,因为如果您不断更新错误的文件,可能会浪费您很多时间。
You can look into service to see which my.ini
is configured in this service.
您可以查看服务以查看my.ini
此服务中配置的内容。