Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get general and slow query logs functional?

Status
Not open for further replies.

jbellCNS

Programmer
Jun 28, 2011
9
I am moving from sql server to MySql 5.6 on Windows Server 2008, and want to log everything for a little bit, especially any slow queries with non-indexed joins.

I started with MySql Administrator, but when I check the "Query Logfile" or anything below "Binary Logfile" in the "Log files" tab of "Startup Variables", the server refuses to start, only giving me the message "Server could not be started".

I dug into this farther, and did find this message in the Windows Logs section of the server management: "C:\mysql\bin\mysqld: unknown option '--log-slow-queries'

For more information, see Help and Support Center at ".

I have been working with this for too long without coming to a satisfactory solution. I've tried moving to table-based logging, which allowed the server to start, but logged nothing, as well as manually editing the live my.ini file.

These are the lines in my.ini that I believe should be fixing the problem, but are not. Any assistance would be appreciated.

slow-query-log
log-output = FILE
long_query_time = 1
slow_query_log = 1
general-log=1
expire_logs_days = 3
log-slow-queries=1
 
From my own settings file:
Code:
log="C:/Program Files/MySQL/MySQL Server 5.1/log/allqueries.sql"
#log-bin="C:/Program Files/MySQL/MySQL Server 5.1/log/allqueries.bin"
#log-bin-trust-function-creators=1
log_slow_queries="C:/Program Files/MySQL/MySQL Server 5.1/log/slowqueries.sql"

Make sure that the directories you refer to actually exist. The files within these directories will be created if they don't.


+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
New PostDonQuichote: Thanks for your response. I added the lines you gave to the my.ini file that is being used by MySql, and modified the paths to where I want to store the files. After I did this and attempted to restart the server it failed again, and in the windows log this is what it said:

C:\MySQL\bin\mysqld: unknown variable 'log_slow_queries=D:/MySQL/log/slowqueries.sql'


Note that I tried several times wityh the slashes, using forward slashes and backslashes, all with effectively the same result.
 
I have resolved this issue. I am not certain what it was, but after working with the install I had extensively I did a fresh download and install, and MySql is now behaving as expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top