Skip to content

Instantly share code, notes, and snippets.

@cafuego
Created May 5, 2013 23:43
Show Gist options
  • Save cafuego/5522599 to your computer and use it in GitHub Desktop.
Save cafuego/5522599 to your computer and use it in GitHub Desktop.
my.cnf for the replication slave that does backup dumps
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
default-storage-engine = InnoDB
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
# Support old password for the radius server on thr access point.
old-passwords = TRUE
default-storage-engine = InnoDB
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 10.10.42.21
#
# * Fine Tuning
#
key_buffer_size = 16M
concurrent_insert = 2
read_buffer_size = 1M
read_rnd_buffer_size = 512K
sort_buffer_size = 256K
bulk_insert_buffer_size = 1M
myisam_sort_buffer_size = 16M
myisam_recover = QUICK,BACKUP
max_allowed_packet = 32M
thread_stack = 128K
wait_timeout = 1800
open-files-limit = 2000
table_cache = 512
tmp_table_size = 8M
max_heap_table_size = 8M
thread_cache_size = 4
max_connections = 32
#
# * Query Cache Configuration
#
# No query cache, cacti says we never actually use it anyway.
query_cache_limit = 128K
query_cache_size = 8M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# log = /var/log/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
# log_slow_queries = /var/log/mysql/mysql-slow.log
# long_query_time = 2
# log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
server-id = 10104221
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 7
max_binlog_size = 128M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
# Ignore duplicate key errors.
# slave_skip_errors = 1062
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
default_storage_engine = InnoDB
sql_mode = NO_ENGINE_SUBSTITUTION
innodb_data_home_dir = /var/lib/innodb
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/lib/innodb
innodb_log_files_in_group = 2
innodb_log_file_size = 16M
innodb-log-buffer-size = 2M
innodb-buffer-pool-size = 128M
innodb_additional_mem_pool_size = 2M
innodb_max_dirty_pages_pct = 70
innodb_file_io_threads = 8
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_thread_concurrency = 4
innodb_io_capacity = 100
# Experimental ourdelta feature.
# innodb_adaptive_checkpoint = 0
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/ssl/certs/cc_cacert.pem
# ssl-cert=/etc/ssl/certs/sql.mel.cc.com.au.pem
# ssl-key=/etc/ssl/private/sql.mel.cc.com.au.key
report-host = slave.mel.cc.com.au
# OurDelta-specific options.
# userstat_running = 0
[mysqldump]
quick
quote-names
max_allowed_packet = 32M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 8M
# * IMPORTANT: Additional settings that can override those from this file!
#
!includedir /etc/mysql/conf.d/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment