Limiting mysql log file size

19,115

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.

Share:
19,115
Gregg Horton
Author by

Gregg Horton

Web Dev focusing on Ruby and Javascript. Branching out into rust.

Updated on July 19, 2022

Comments

  • Gregg Horton
    Gregg Horton almost 2 years

    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

  • Gregg Horton
    Gregg Horton over 11 years
    Thanks i'll attempt that when i can restart the server and see if it works.