Mysql 5.x binary-log disable?

Hi people.

How can I disable binary-logs in mysql?

Why I ask this?

With bacula I use mysql 4.1.X, I detect some files was eating my /var slice, start reading about and found that I could disable this mysql feature, was easy inside the my.cnf file.

I have been running bacula+mysql for more than 2 years.

Now we are doing some new app that will use mysql, them I decide to upgrade from 4.1.x to 5.1.x, I update all my server from scratch 7.0-px, mysql-5.1.x, etc. Everything is working as I espected. But again I start watching this binary-logs inside /var/db/mysql/.

Right now, I don't need this, maybe latter, I'm not running a cluster of mysql servers, If I need to check the perfomance of my querys I will enable this feature, but right now I don't need it.

I have read the mysql handbook, googling around, check mysql forum, ask in the forum, but I still don't know how to disable this.

I try the same procedure as 4.1.x but is nor working anymore, If I comment that line inside /var/db/mysql/my.cnf, mysql won't start x(

I have bee trying a lot things inside this file but none of them works.

Can someone here knows how to disable binary-logs for mysql 5.1.x?

Is possible?

Thanks for your time:)
 
You could at least tell us what was the option working on 4.1.

Did you tried binlog-ignore-db?
 
This the option I disable in mysql 4.1.x with 6.1 Rel..-p21

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

Let me try the option u say.

Thanks for your quick reply ale :)
 
Looks like that was the trick, I have been testing mysql and looks like my logs stop increase their size.

Tomorrow will run a big process and I will verify this and let u know, but looks like problem solve, I still reading about that option to understand how it works deeply.

Thanks again :)
 
Hi blackjack.

The problem here is not the binary-log rotation, or how to deal with those logs.

The goal is "How to disable the binary-logs with mysql 5.1" this is the main idea of this thread.

But thanks for your contribution :).
 
Hi ale.

Looks like I have found how to disable the binary-logs, I setup a new machine for testing mysql.

The option binlog-ignore-db is good to disable the binary logging in some DB but mysql still continue running with this option enable:

root@mysqladmin variables | grep log_bin
log_bin | ON

I was working with the file my-large, I copy this file to /var/db/mysql/my.cnf

Opened and remove some options that I don't need specially the Master/Slave stuff.

My file right now looks like this:

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
thread_concurrency = 8

#skip-networking

# Disable Federated by default
skip-federated

#log-bin=mysql-bin
#binlog_format=mixed

#server-id = 1
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/db/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/db/mysql/
#innodb_log_arch_dir = /var/db/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 256M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 64M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Looks like the trick is this 2 options:

#log-bin=mysql-bin
#binlog_format=mixed

As soon as I enable one of them, this guy start and change from log_bin off to on.

If I put a nothing in front of them, mysql won't start x(

Them with a comment this feature is gone :beer

We just need more test here, I will run a big task tomorrow and I will see if this affect me.

Thanks again for your time ale :)
 
I know - it's been a long time without a response. If I were in your shoes, this is probably what I'd do: Use a symlink to send binary log messages to /dev/null until you really want them.

To do that, I'd use these steps:

1) Stop mysqld (skip this if it's not running now).
2) Remove the existing binary log then replace it with a symlink to /dev/null.
3) Restart your mysqld

If that isn't good enough for you, consider adding log-bin= on a line by itself. That way, the server knows not to log updates at all. Be sure you also have any other binary-logging statements commented out or removed.

KB
 
Back
Top