Limiting mysql log file size
Asked Answered
S

1

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

Sultana answered 28/11, 2012 at 20:2 Comment(4)
Are you referring to InnoDB? If so, read this article how to change innodb_log_file_size safely.Antimasque
You can use mysql-log-rotate for thisDeming
@njk: The InnoDB log file does not increase in size.Ermeena
Which file are you referring to? InnoDB transaction log (ib_logfile0, ib_logfile1)? Binary log? Relay log? Slow Log? Error Log?Roadability
R
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.

Radar answered 28/11, 2012 at 20:29 Comment(1)
Thanks i'll attempt that when i can restart the server and see if it works.Sultana

© 2022 - 2024 — McMap. All rights reserved.