What is up will all this binary-log in my MySQL database ? They are taking to much space and i need ot get rid of them ! Not so fast ! First you need to know what are the binary logs and for what they are used: What are they ? The binary log contains “events” that describe database changes such as table creation operations or changes to table data. What do they serve for ? Replication - the binary log on a master replication server provides a record of the data changes to be sent to slave servers. The master server sends the events contained in its binary log to its slaves, which execute those events to make the same data changes that were made on the master. Recovery Operations -require the use of the binary logs. After a backup has been restored, the events in the binary log that were recorded after the backup was made are re-executed. These events bring databases up to date from the point of the backup. Cons form enabling binary log in MySQL 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. So if you are on production MySQL database binary logs are pretty important. There is allot to talk about the binary logs but now let's see how can we safely clean old logs. We will start by listing our binary logs: You can choose to cleanup until one binary log only by passing the name if it: This will erase all binary logs before bih001.000075, it will not cleanup the actual binary log that you have passed. Or you can use a timestamp predicate type: Another way is to setup a log purge policy. This is possible by setting up the variable expire-logs-days. This variable will setup the value of days that the log will automatically expire. Example: