If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How do I setup proper logging in Windows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-23-10, 14:03
brendan.anderson brendan.anderson is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
How do I setup proper logging in Windows

I have MySQL 5.0.51 running on Windows 2003 and I administer it with MySQL Administrator. About a month ago I noticed that it was generating huge log files (90 gigs - myisam.log and servername.log), I check the Startup Variable > Log Files and, sure enough, I had check marks set to log everything and the checkbox at the bottom "Expire Log Days" was unchecked.

So, I checked the "Expire Log Days" and set it to 14. I stopped the server, renamed the offending log files and started the server again. I checked again yesterday and again I'm growing huge log files (servername.log and just .log).

So this time, I unchecked everything in Startup Variable > Log Files.

I guess that means I'm not logging anything. I'm not doing any replication and I never looked at the log files for anything, but this still makes me very nervous.

I have looked on-line for instructions on how to properly flush the logs (if that is even the right terminology) in a Windows environment, and I only find instructions for *nix with a few passing references to windows ("setup a cron job to clear logs" for example).

Does anyone know how to properly set up MySQL on Windows so that it logs a resonable amount of data? Or do I even need logs?

Thanks,
Brendan
Reply With Quote
  #2 (permalink)  
Old 03-23-10, 18:43
scottb scottb is offline
Registered User
 
Join Date: Oct 2003
Posts: 60
is the servername.log the general query log? I think so..
just turn it off in your my.cnf file
Reply With Quote
  #3 (permalink)  
Old 03-24-10, 10:15
brendan.anderson brendan.anderson is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
Thanks for the reply scottb.

It turns out I don't have a my.cnf file. I use MySQL Administrator, I don't know if that eliminates the need for a my.cnf file.

Either way, I believe I have essentially done what you suggested through MySQL Administrator by stopping all logs. I just wonder how safe this is.

Also, the file called ".log" was way bigger than the "servername.log" (15GB vs 2GB)
Reply With Quote
  #4 (permalink)  
Old 03-24-10, 10:30
scottb scottb is offline
Registered User
 
Join Date: Oct 2003
Posts: 60
You should have a my.ini file since your using windows.

Whats inside these big log files?
Reply With Quote
  #5 (permalink)  
Old 03-24-10, 10:50
brendan.anderson brendan.anderson is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
I do have a my.ini file and I found this in there:

#Enter a name for the query log file. Otherwise a default name will be used.
#log=

servername.log contains mostly select statements. They just look like regular queries that my Drupal install uses. Just pages and pages of:

100128 11:45:58 1 Query SELECT COUNT(pid) FROM url_alias
1 Query SELECT name, filename, throttle FROM system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC
1 Query SELECT * FROM menu_custom ORDER BY title
1 Query SELECT dft.type, dft.title, dft.locked FROM date_format_types dft ORDER BY dft.title
1 Query SELECT format, type, language FROM date_format_locale
1 Query SELECT * FROM path_redirect WHERE path = 'node/100' AND (language = 'en' OR language = '') ORDER BY language DESC LIMIT 0, 1
1 Query SELECT * FROM menu_router WHERE path IN ('node/100','node/%','node') ORDER BY fit DESC LIMIT 0, 1
1 Query SELECT data, created, headers, expire, serialized FROM cache WHERE cid = 'schema'
1 Query SELECT n.nid, n.type, n.language, n.uid, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, n.tnid, n.translate, r.vid, r.uid AS revision_uid, r.title, r.body, r.teaser, r.log, r.timestamp AS revision_timestamp, r.format, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE n.nid = 100
1 Query SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN (1,6,2,11)
1 Query SELECT nt.type, nt.* FROM node_type nt ORDER BY nt.type ASC
1 Query SELECT data, created, headers, expire, serialized FROM cache_content WHERE cid = 'content_type_info'

the ".log" file won't open it's too big.

Are there logs that are important to keep? I don't do any replication and I back up the db every night do I still need some logs?
Reply With Quote
Reply

Tags
log, logs, mysql, windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On