Forum Moderators: phranque
I was checking up on mysql database sizes, my current db is about 28 gig, but when i browse to /var/lib/mysql the disk space used in this directory is close on 55 gig.
I noticed that there are a lot of files in the following format....
computername-bin 001 through to computername-bin 061
If my understanding is correct these binnaries are used for replication purposes across more servers, I have since moved all the files into a different directory and have seen no ill efects, is it safe for me to dump them, or are they used for some other purpose?
Mack.
Once a slave is replicating, you will find in its data directory one file named
`master.info'and another named`relay-log.info'. The slave uses these two files to keep track of how much of the master's binary log it has processed. Do not remove or edit these files, unless you really know what you are doing and understand the implications. Even in that case, it is preferred that you use theCHANGE MASTER TOstatement.References:
Replication Relay and Status Files [dev.mysql.com]
How to Set Up Replication [dev.mysql.com]
...and here is the info you are more than likely looking at...
If you are using replication, you should not delete old binary log files until you are sure that no slave still needs to use them. One way to do this is to domysqladmin flush-logsonce a day and then remove any logs that are more than three days old. You can remove them manually, or preferably usingPURGE MASTER LOGS(see section 14.6.1 SQL Statements for Controlling Master Servers), which will also safely update the binary log index file for you (and which can take a date argument since MySQL 4.1)Resource:
The Binary Log [dev.mysql.com]