8

I have a mysql log file that regularly goes over 30gb, this sucks when you realise that your server is full because of this file. I need a simple solution to limit this file to about 1gb, i don't need logs that run that long, and i'd rather avoid this problem in the future.

Any ideas? Thanks

  • Are you referring to `InnoDB`? If so, read [this article](http://www.mysqlperformanceblog.com/2011/07/09/how-to-change-innodb_log_file_size-safely/) how to change `innodb_log_file_size` safely. – Kermit Nov 28 '12 at 20:06
  • You can use [mysql-log-rotate](http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html) for this – Ibu Nov 28 '12 at 20:07
  • @njk: The InnoDB log file does not increase in size. – Bill Karwin Nov 28 '12 at 20:32
  • 1
    Which file are you referring to? InnoDB transaction log (ib_logfile0, ib_logfile1)? Binary log? Relay log? Slow Log? Error Log? – RolandoMySQLDBA Nov 28 '12 at 21:10

1 Answers1

4

To specify it in the my.cnf file, backup your current my.cnf file (always recommended), stop slave, stop the MySQL server and place the following option:

   # relay log restrictions
   relay-log-space-limit=15G

Then save and quit the file and start MySQL. Unless you configured differently, MySQL will automatically start the slave thread.

echo_Me
  • 37,078
  • 5
  • 58
  • 78
  • Thanks i'll attempt that when i can restart the server and see if it works. –  Nov 28 '12 at 21:37