WAMP ignore my.ini

。_饼干妹妹 提交于 2019-12-23 02:32:25

问题


C:\wamp\bin\mysql\mysql5.6.17 has my.ini. I add text log=c:/wamp/logs/mysql_query.log but it's not working.

Any changes do not work. I tried to rename the file myblablabla.ini, but WAMP server successfully started. I think, he uses a different configuration file. How to find it?

Thanks for the help.


回答1:


If you are using the 64bit version of WAMPServer 2.4 or 2.5 there was a little mistake in the release.

MySQL looks in its ini file for a section that matches its service name, to get its parameters from. The 64bit MySQL Service is called wampmysqld64 and therefore the my.ini section header should also be wampmysqld64

Use the wampmanager menus to edit my.ini like this

wampmanager -> MYSQL -> my.ini

So edit your my.ini and find this line

[wampmysqld]

Then change it to

[wampmysqld64]

MySQL will now pickup the parameters you set within that section.




回答2:


The answer above is correct but not totally, at least for me. I'm using wampserver 2.5 64bit. I must add BOTH [wampmysqld64] and [mysqld64] section in my .ini file in order to make it works!

[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

  1. Run select @@sql_mode; // check results

  2. Wamp > MySQL > my.ini // edit file with the code I've mentioned above.

  3. Restart wamp all services

  4. Run select @@sql_mode; // check results, need to be:

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



来源:https://stackoverflow.com/questions/26668866/wamp-ignore-my-ini

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!