In short, you may find mysqld-bin.xxxxxx files wasting your disk space while you don’t know what are they used for. It is “safe” to remove this binary logs file by executing the following commands after login your MySQL server:

db:~# mysql -uroot -p
Enter password:
mysql> FLUSH LOGS;

These mysqld-bin.xxxxxx files actually store every executed SQL statements, maybe since you install and run MySQL server as a default configuration of your MySQL Server packages.

As extract from my.ini MySQL Server configuration file:

# The following can be used as easy to replay backup logs or for replication.
#server-id = 1
log-bin = /var/log/mysql/mysql-bin.log

Running a server with binary logging enabled makes performance slightly slower. However, the benefits of the binary log in enabling you to set up replication and for restore operations generally outweigh this minor performance decrement.


If you only have one single server with proper backup, you are mostly safe to clear the binary log by executing the commands.

For your further reading, please refer to