On Sun, Oct 26, 2008 at 9:13 AM, Madan Thapa <[EMAIL PROTECTED]>wrote:

> On Sat, Oct 25, 2008 at 5:50 AM, Grant Peel <[EMAIL PROTECTED]> wrote:
>> > Hi all,
>> >
>> > I had a server pretty much locked up this morning due to the mysql bin
>> logs filling up the /var filesystem.
>> >
>> > I had been investigating the my.cnf settings file a white back, got
>> sidetracked, and never finished it.
>> >
>> > The bin logs are named:
>> >
>> > /var/db/mysql/myserver-bin.000001
>> > /var/db/mysql/myserver-bin.000002
>> > /var/db/mysql/myserver-bin.000003
>> > /var/db/mysql/myserver-bin.000004
>> >
>> > I assume a new one is created each time the mysql server is started. I
>> had to shut down all services on the server, delete all these files and
>> restart everything.
>> >
>> > Anywho, the two questions are:
>> >
>> > 1. Are these files used when 'fixing' tables, or, are they only used for
>> the master/salve replication?
>> >
>> > 2. Is it safe to, and how do I, turn off the bin logs altogether (there
>> are no slave servers),
>> >
>> > 3. What my.cnf settings would you all reccomend for:
>> >
>> > Mysql4, running on, FreeBSD 6, 1 GB Memory, var fs is 5 GB, 250 virtual
>> domains on the server, of which 50 may be using mysql/php (for bulliten
>> boards etc).
>> > (I am reading through the /usr/local/share/mysql *.cnf files ...)
>> >
>> >
>> >
>>
>
>


Hi,



Goto mysql prompt as root and run



mysql> PURGE MASTER LOGS TO 'myserver-bin.000004';


in your case.



Here is a real world example  with 3 binlogs:
===========================================================


mysql> SHOW MASTER LOGS;
+---------------------+-----------+
| Log_name            | File_size |
+---------------------+-----------+
| serverName-bin.000001 | 499395745 |
| serverName-bin.000002 |  85511890 |
| serverName-bin.000003 |    135043 |
+---------------------+-----------+
3 rows in set (0.00 sec)



mysql> PURGE MASTER LOGS TO 'serverName-bin.000004';
ERROR:
Target log not found in binlog index

mysql> PURGE MASTER LOGS TO 'serverName-bin.000003';
Query OK, 0 rows affected (1.27 sec)

mysql> quit
Bye





Add the line:-
===============

expire_logs_days = 15



in my.cnf to rotate/purge binary log files automatically after 15 days.

Then restart mysql service.

Reply via email to