Linux OSCent dev sda5 running out of space
This is my first time as a member but I have spent a lot of time looking at the ports.
My server is running OSCent.
I had a problem with my server where the dev/sda5 partition was running out of space. After a lot of searching around for a solution I thought it only right I should share my findings.
I found the cause to be the MySQL binary log files were getting very big, in some cases over 1Gb. The solution to this issue was to find a way of removing them but there was not a lot of information on how this was done. So this is what I did.
In the var/mysql directory I found files like:
All for these files were over 1Gb.
To remove them I found an artical which discribed how to use "Purge binary logs".
Login to your server at the command prompt.
From the command prompt login to MySQL:
Command> mysql -u admin -p
Enter your password
This account must have "super privilgies".
To purge the "Binary logs"
Command> purge binary logs <followed by the name of the log file >
Command: purge binary logs before <followed by a date >
Example: purge binary logs before '2011-02-14 07:30:00';
This will remove all the binary log file before the given date and time.
I also found that from the command prompt I could enter a command that would automatically remove the binary logs.
Command> expire_logs_days=n; < n is the number of days you wish to keep your binary log files.
The command format for this is:
Command-Line Format --expire_logs_days=#
Option-File Format expire_logs_days
Option Sets Variable Yes, expire_logs_days
Variable Name expire_logs_days
Variable Scope Global
Dynamic Variable Yes
I do hope someone finds this helpful, I know I did.