Skip to content

Instantly share code, notes, and snippets.

Created August 12, 2014 20:54
Show Gist options
  • Save anonymous/a862e703e41514643f14 to your computer and use it in GitHub Desktop.
Save anonymous/a862e703e41514643f14 to your computer and use it in GitHub Desktop.
# Example MySQL config file for very large systems.
#
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
# Fine Tuning
max_allowed_packet = 512M
# Buffers and caches
table_cache = 4096
tmp_table_size = 96M
max_heap_table_size = 96M
join_buffer_size = 1M
key_buffer_size = 128M
character_set_server = utf8
collation_server = utf8_general_ci
init-connect = 'SET NAMES utf8'
#default-time-zone = utc
thread_cache_size = 64
# InnoDB
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_additional_mem_pool_size = 200M
innodb_log_file_size = 80M
innodb_log_buffer_size = 1M
innodb_lock_wait_timeout = 50
innodb_buffer_pool_size = 2016M
innodb_thread_concurrency = 4
innodb_write_io_threads = 8
skip-external-locking
key_buffer_size = 384M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
general_log=1
general_log_file=/var/log/mysql/mysql.log
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Set .._log_file_size to 25 % of buffer pool size
[mysqldump]
quick
max_allowed_packet = 256M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment