PDA

View Full Version : mysql-bin.0000xx very larg file size



Blueman
04-05-2010, 08:51 PM
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

smtalk
04-05-2010, 11:33 PM
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

Blueman
04-05-2010, 11:59 PM
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

smtalk
04-06-2010, 12:36 AM
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.

Blueman
04-07-2010, 05:30 AM
Hello,

After I change my.cnf like below


# 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

xerophyte
04-09-2010, 04:32 PM
- 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

prale
06-21-2010, 04:33 PM
Don't forget to also #comment-out:

expire_logs_days = 14

and

binlog_format=mixed

or mysql won't start