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
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.)
-
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).– NzallNov 5, 2020 at 15:37
-
1
-
Cycle the log as in turn off the server, delete the logfile and restart the server?– NzallNov 5, 2020 at 20:57
-
@Nzall - On unix, the restart is not necessary;
FLUSH LOGS;
is one of the steps. Nov 5, 2020 at 22:29 -