Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2010

    Unanswered: 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?


  2. #2
    Join Date
    Oct 2003
    is the servername.log the general query log? I think so..
    just turn it off in your my.cnf file

  3. #3
    Join Date
    Mar 2010
    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)

  4. #4
    Join Date
    Oct 2003
    You should have a my.ini file since your using windows.

    Whats inside these big log files?

  5. #5
    Join Date
    Mar 2010
    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.

    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.picture, 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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts