how to turn on MySQL query logging?

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

how to turn on MySQL query logging?

Postby webcomm » 06. May 2011 22:16

How do I turn on query logging in XAMPP? I have read that I need to find a my.cnf file, but I have searched the entire xampp directory and subdirectories, and there is no such file.

I'm on Win XP.

Thankx
webcomm
 
Posts: 4
Joined: 06. May 2011 22:07

Re: how to turn on MySQL query logging?

Postby webcomm » 07. May 2011 15:45

I see from reading that this file can alternately be called my.ini, my.cnf, my.cnf.bak, etc, and can be located in multiple places. I find myself wishing the file could have only one name and be located in only one possible place in my file system, though that may be an issue with the OS.

I found one copy of my.ini at C:\xampp\mysql\bin -- if I leave it in that location, will it work? Are there other locations where mysql may look first and where I must ensure I do not have a copy of another file with any of the preceding file names?

Thank you

ps -- Is there some way I can test whether I am editing the correct file in the correct location? Is there something I can add to the file that will make something obvious happen (website outage, errors, etc) if it is the correct config file? My changes to these config files (variously named and located) do not seem to have any effect. My XAMP version is 1.7.2. MySQL is MySQL 5.1.37. My OS is Windows XP.

pps -- By the way I do see that there are some relevant instructions in the my.ini file itself, but I don't understand these instructions and don't know if they are up to date. My attempts to follow the comments in the my.ini file itself have not gotten me to a point where I can know whether I am editing the right file in the right location. Thanks for your help.
webcomm
 
Posts: 4
Joined: 06. May 2011 22:07

Re: how to turn on MySQL query logging?

Postby webcomm » 25. May 2011 14:25

Hi all,

I'm still wondering how to turn on MySQL query logging. Any ideas? Is this forum an appropriate place to get help with this?

In my.ini, I see this:

general_log = 1
general_log_file = "C:/xampp/mysql/data/mysql.log"

But when I look in that path, I see no mysql.log file. So I created that file, but nothing is being logged there. What else do I need to do so queries are logged to that file?

Many thanks,
Ryan
webcomm
 
Posts: 4
Joined: 06. May 2011 22:07

Re: how to turn on MySQL query logging?

Postby webcomm » 25. May 2011 15:13

I got it working. I think the trick is to not start MySQL with the XAMPP control panel, and instead to start it in the command prompt like so...

mysqld --general_log=1
webcomm
 
Posts: 4
Joined: 06. May 2011 22:07


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 29 guests