问题
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
Run
select @@sql_mode;
// check resultsWamp > MySQL > my.ini // edit file with the code I've mentioned above.
Restart wamp all services
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