Large MySQL Bin files – High disk usage by MySQL Bin files

You may have seen “server-bin.n” or “mysql-bin.00000n” (n represent num0der) under your MySQL directory (/var/lib/mysql). These files are binary logs for MySQL. The binary log contains all statements that update data. It also contains information about how long each statement took that updated data.

MySQL binary logs are used for data recovery and replication.

How to Disable MySQL binlogging?

If you are not using replication, you can disable MySQL binary loggin from your MySQL configuration file (my.cnf or my.ini). Oopen your MySQL configuration file in the editior and search for log_bin. Either comment that line or remove it from your configuration file.

#log_bin = /var/log/mysql/mysql-bin.log

You also need to remove or comment following lines if they are present:

#expire_logs_days = 10
#max_binlog_size = 100M

Save your configuration file and restart your MySQL service.

Leave a Reply