?
Solved

MySQL for windows - how to turn on logging to a file??

Posted on 2008-02-05
6
Medium Priority
?
5,058 Views
Last Modified: 2011-10-19
I have MySQL installed on a windows 2003 server.  I have not used MySQL before, and do not know how to turn on logging to a file.  If I remote in the the server it is installed on, and launch the MySQL Administrator, I do see a section for server logs.  When I enter that section, the right side of the screen is all grayed out.  I'm confused how to proceed.  I want to view (or turn on) any errors that are occurring to troubleshoot an application problem we are having.
Thanks.
0
Comment
Question by:sah18
  • 4
  • 2
6 Comments
 
LVL 10

Expert Comment

by:adrpo
ID: 20826569

If you are connected to MySQL via ODBC, then you can enable ODBC logging:
Control Panel->Administrative Tools->Data Sources->Tracing.

Cheers,
za-k/
0
 
LVL 10

Expert Comment

by:adrpo
ID: 20826588

You could also start the MySQL server with
mysqld --log=drive:\path\to\file
to enable the query logging.

More here:
http://dev.mysql.com/doc/refman/5.0/en/query-log.html

Cheers,
za-k/
0
 
LVL 9

Author Comment

by:sah18
ID: 20831499
I want to turn on logging of errors.  I'm not sure I follow you odbc listing.  I'm directly on the server that MySQL is running on, in the MySQL Administrator software.  To be clearer, I've attached a screenshot of the Server Logging section of the MySQL Administrator that I'm referencing in my question.  See how all the options are grayed out?  How to I enable logging of errors to help troubleshoot an issue we are having??  I just don't see how to turn on error logging.
Thanks again.

ScreenShot001.bmp
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
LVL 10

Accepted Solution

by:
adrpo earned 2000 total points
ID: 20832029

Hi,

On my computer there is nothing in the Server Logs either in MySQL Administrator.
However, if you go to the directory:
drive:\path\to\mysql\data
You will find a text file called ComputerName.err

All the errors are logged into that file.

Cheers,
za-k/
0
 
LVL 10

Expert Comment

by:adrpo
ID: 20832302

Ok, you need to run your server with --log:
http://dev.mysql.com/doc/refman/5.0/en/query-log.html
Open Services on your computer, stop the MySQL server, then run mysqld from the command
line:
mysqld.exe --defaults-file="c:\\bin\\mysql\\my.ini" --log-error --log-warnings --log
Then look into
drive:\path\to\mysql\data
for a file ComputerName.log
In there you will find all the queries send to the server.
More here:
http://dev.mysql.com/doc/refman/5.0/en/query-log.html

Cheers,
za-k/
0
 
LVL 9

Author Closing Comment

by:sah18
ID: 31428210
Thank you for your help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question