0

I have changed MySQL 8 on my Windows 10 development machine to write logfiles (general log and slow queries log) to "E:\mysql logfiles". I'd like to compress this directory using the Windows "Compress Directory to save space" advanced feature in the Windows 10 directory properties to save space (currently my logfile is over 50 GB). I'm wondering though: is this a good idea? Or will this break MySQL in (subtle or not) ways?

1 Answer 1

2

The Windows feature to compress a directory is transparent to all applications. However, it does slow down I/O operations some.

The General Log should not be left on forever; it is a big disk hog. Instead, turn it on only long enough to get the necessary debugging info, then turn it off and toss the log file.

Or, you could log to TABLE and not FILE; I think the table has a limit. (Check the settings.)

5
  • This is a development machine, as in a machine I actively develop on. I'd rather not disable the general log because It's sometimes not feasible to run something that causes problems again (like when a long-running task fails to write to the database after 30 minutes of running and I don't want to wait another 30 minutes to run the query again).
    – Nzall
    Nov 5, 2020 at 15:37
  • 1
    Then at least cycle the log periodically.
    – Rick James
    Nov 5, 2020 at 15:37
  • Cycle the log as in turn off the server, delete the logfile and restart the server?
    – Nzall
    Nov 5, 2020 at 20:57
  • @Nzall - On unix, the restart is not necessary; FLUSH LOGS; is one of the steps.
    – Rick James
    Nov 5, 2020 at 22:29
  • I'm on Windows, so Unix commands don't really help me all that much.
    – Nzall
    Nov 6, 2020 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.