What if the general log of mysql is too big?

what to do if the general log of mysql is too large

Mar.20,2021

you can cut logs at the same time every day through Logrotate .
needs to maintain a configuration file as follows:

/var/log/mysql/*.log {
  create 644 mysql mysql
  notifempty
  daily
  rotate 5
  missingok
  nocompress
  sharedscripts
  postrotate
  -sharp run if mysqld is running
  if test -n "`ps acx|grep mysqld`"; then
    /usr/bin/mysqladmin flush-logs
  fi
  endscript
}
Menu