mysql-bin.0000xx very larg file size

Blueman

Verified User
Joined
Nov 20, 2009
Messages
53
Hello,

I have a problem with var/lib/mysql/mysql-bin.0000xx file size is larg and many. like picture below

How can I reduce file size or can I delete some file from here.

Thank you
Blueman
 

Attachments

  • mysql.JPG
    mysql.JPG
    37.9 KB · Views: 504
If you do not want to log bin, then edit /etc/my.cnf and remove log-bin line from it (or comment it out), restart MySQL afterwards.

It's recommended to use RESET MASTER or PURGE MASTER LOGS to remove them (but it should have no problems with a simple rm if you have no replication set up):
http://dev.mysql.com/doc/refman/5.1/en/binary-log.html
 
Last edited:
Hello,

Now My my.cnf look like below

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

Can I disable it like ?

# Replication Master Server (default)
# binary logging is required for replication
#log-bin=mysql-bin

and please confirm that I can delete mysql-bin.0000xx with no error after delete it.

Thank you
Blueman
 
Yes, it's a correct way to disable it. And it should have no problems after "rm /var/lib/mysql/mysql-bin.0000??" if you are not using replication.
 
Hello,

After I change my.cnf like below

Code:
# Replication Master Server (default)
# binary logging is required for replication
#log-bin=mysql-bin

I can't restart mysqld service error is like below

service mysqld restart
Shutting down MySQL.....[ OK ]
Starting MySQL.Manager of pid-file quit without updating file.[FAILED]

My MySQL version is 5.1.x (complied by custombuild)

How to fix the problem

Thank you
Blueman
 
- Make sure you don't do any replication, if you have replication configured to slave from this database you will break the replications.

- If you don't have replication configured you can purge the bin logs after login as root and type "reset master"

- Then comment the bin log line in the /etc/my.cnf and stop mysql

- then start again

- You might want to tail the /var/log/messages and mysql error logs to see if there error
 
Don't forget to also #comment-out:

expire_logs_days = 14

and

binlog_format=mixed

or mysql won't start
 
Back
Top