简体   繁体   English

WAMP忽略my.ini

[英]WAMP ignore my.ini

C:\\wamp\\bin\\mysql\\mysql5.6.17 has my.ini. C:\\ wamp \\ bin \\ mysql \\ mysql5.6.17具有my.ini。 I add text log=c:/wamp/logs/mysql_query.log but it's not working. 我添加了文本log=c:/wamp/logs/mysql_query.log但是它不起作用。

Any changes do not work. 任何更改均无效。 I tried to rename the file myblablabla.ini, but WAMP server successfully started. 我试图重命名文件myblablabla.ini,但是WAMP服务器成功启动。 I think, he uses a different configuration file. 我认为,他使用了不同的配置文件。 How to find it? 如何找到它?

Thanks for the help. 谢谢您的帮助。

If you are using the 64bit version of WAMPServer 2.4 or 2.5 there was a little mistake in the release. 如果您使用的是WAMPServer 2.4或2.5的64位版本,则该发行版中会出现一些错误。

MySQL looks in its ini file for a section that matches its service name, to get its parameters from. MySQL在其ini文件中查找与其服务名称相匹配的部分,以获取其参数。 The 64bit MySQL Service is called wampmysqld64 and therefore the my.ini section header should also be wampmysqld64 64位MySQL服务称为wampmysqld64 ,因此my.ini节标题也应为wampmysqld64

Use the wampmanager menus to edit my.ini like this 使用wampmanager菜单像这样编辑my.ini

wampmanager -> MYSQL -> my.ini

So edit your my.ini and find this line 因此,编辑my.ini并找到此行

[wampmysqld]

Then change it to 然后将其更改为

[wampmysqld64]

MySQL will now pickup the parameters you set within that section. MySQL现在将提取您在该部分中设置的参数。

The answer above is correct but not totally, at least for me. 至少对于我来说,以上答案是正确的,但并非完全正确。 I'm using wampserver 2.5 64bit. 我正在使用wampserver 2.5 64bit。 I must add BOTH [wampmysqld64] and [mysqld64] section in my .ini file in order to make it works! 我必须在.ini文件中同时添加[wampmysqld64]和[mysqld64]部分,才能使其正常工作!

[wampmysqld64]
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

[mysqld64]
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Go to wamp icon and do like this: 1. Wamp > MySQL > MySQL console 转到wamp图标并执行以下操作:1. Wamp> MySQL> MySQL控制台

  1. Run select @@sql_mode; 运行select @@sql_mode; // check results //检查结果

  2. Wamp > MySQL > my.ini // edit file with the code I've mentioned above. Wamp> MySQL> my.ini //使用上面提到的代码编辑文件。

  3. Restart wamp all services 重新启动所有服务

  4. Run select @@sql_mode; 运行select @@sql_mode; // check results, need to be: //检查结果,需要为:

+--------------------------------------------+ | @@sql_mode | +--------------------------------------------+ | NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +--------------------------------------------+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM