Hi, i checked for large files and found in the directory /var/lib/mysql
files over 2 gigabytes called host-bin.000001 to host-bin.000040
That dorectory is taken up to 20g so far, what are these files? are they safe to delete?
These are MySQL binary log files. They contains *every single SQL statement* executed on your MySQL server, which is useful for things like incremental backup, clustering with log shipping + playback, etc.
If you are not thinking of clustering your MySQL servers, then they might be useless. I might be wrong, but I always delete them and disable log-bin in the MySQL configuration file.
1. Find /etc/mysql/my.cnf
2. Locate "log-bin"
3. Make sure that line has been commented out, i.e. prefix with '#'.
4. Restart MySQL server.