View previous topic :: View next topic |
Author |
Message |
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Wed May 23, 2012 4:06 pm Post subject: mysql-bin log files |
|
|
The mysql-bin log files are taking up alot of disk space. I tried to purge the files with mysql statement 'purge binary logs' but nothing happens. The 'show variables' reveals the bin log compiled in. So, I am stumped why I can not purge them.
Do you have a recommended way of dealing with these files?
thanks |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed May 23, 2012 6:27 pm Post subject: |
|
|
The right syntax would be
purge binary logs to 'logname';
logname up to e.g. if you want to delete first 100 binary logs
purge binary logs to 'mysql-bin.000100';
or
purge binary logs before 'datetime expr';
More info at
http://dev.mysql.com/doc/refman/5.1/en/purge-binary-logs.html
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Wed May 23, 2012 7:01 pm Post subject: |
|
|
my fault. I should have been clear. I tried those statements. Stop mysql and restart but it does not purge the files.
Mysql docs say you can delete them if you are not doing replication. Maybe that is the way to go.
thanks |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed May 23, 2012 8:23 pm Post subject: |
|
|
If you are running an innodb database you might corrupt the database if you delete them manually.
You don't have to stop mysql, mysql should be running.
What's the output of
ls -lh /var/lib/mysql/mysql-bin.*
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Thu May 24, 2012 9:05 pm Post subject: |
|
|
thanks for the input. I've taken care of it.
thanks |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Thu May 24, 2012 9:10 pm Post subject: |
|
|
Just for the information, did you do something else, or the above command fix it?
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Thu May 24, 2012 9:38 pm Post subject: |
|
|
I read the manual at mysql and ended up deleting it. All is okay. I do daily dumps of databases and the manual said it would work as long as I wasn't doing replication.
thanks |
|
Back to top |
|
|