Tags: mysql
10/15/07
MySQL binary log space (Debian)
So it turns out that what is filling up my root partition is my MySQL binary logs.
A collection of fat files in /var/log/mysql ...
So I had several options:
- Move the logs to a different partition
- Increase the size of the root partition
- Decrease the size of the logs
The first option is probably the most reasonable one. But since I had other plans for the evening I actually went with the last option: decreasing the size of the logs! ![]()
The magic conf is located in /etc/mysql/my.cnf and the magic line is:
Code:
expire_logs_days = 5 |
It was set to 10 but I have no idea why I even need 5 days. Aren't those logs only useful until transactions commit to disk, and replication executes. Oh maybe if you have replicated slaves more than 5 days behind the master??
10/01/07
What's my MySQL version number?
In order to determine which MySQL version you're running you can type the following command: mysql -V
Sample results:
# mysql -V
mysql Ver 14.7 Distrib 4.1.11, for pc-linux-gnu (i386)
# mysql -V
mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2
Now, if you want to query for the version number while beign logged in (PHP script for example), just go with: SELECT VERSION(); .
I believe this is only working since MySQL 4 though.