Skip to main content
edited tags
Link
dr_
  • 32.4k
  • 22
  • 102
  • 150
Source Link

MySQL general_log.CSV is 47GB in Production – How to Free Space?

I’m managing a production MySQL server running on a VM, and I just discovered that the general_log.CSV file in /var/lib/mysql/mysql/ has grown to 47GB, consuming almost 70% of the disk space.

Here’s the output of du -sh /var/lib/mysql/mysql/*:

8.0K /var/lib/mysql/mysql/general_log_213.sdi 4.0K /var/lib/mysql/mysql/general_log.CSM 47G /var/lib/mysql/mysql/general_log.CSV 16K /var/lib/mysql/mysql/slow_log_214.sdi 4.0K /var/lib/mysql/mysql/slow_log.CSM 0 /var/lib/mysql/mysql/slow_log.CSV 

Since this is a production environment, I need a safe way to free up space without affecting MySQL operations.

Questions:

  • Is it safe to delete or truncate general_log.CSV in a live production database?
  • What is the recommended way to clear this log without disrupting MySQL?
  • what is the purpose of that file