Skip to content

Instantly share code, notes, and snippets.

@uhlhosting
Created May 18, 2016 14:33
Show Gist options
  • Save uhlhosting/408bbe5b104e33ae8cecb670ab18e883 to your computer and use it in GitHub Desktop.
Save uhlhosting/408bbe5b104e33ae8cecb670ab18e883 to your computer and use it in GitHub Desktop.
Mysql Config File
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[client]
#character-set-server=utf8
[mysqld]
local-infile = 0
collation-server = utf8_unicode_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
max_allowed_packet = 268435456
max_connect_errors = 10
max_connections = 80
max_user_connections = 60
#safe-show-database
#skip-innodb
#skip-locking
#skip-networking
skip-external-locking
table_definition_cache = 5000
table_open_cache = 5000
low_priority_updates = 1
concurrent_insert = 2
open_files_limit = 25000
performance_schema = OFF
# Enable logs
#general-log = ON
#log_error = ON
#explicit_defaults_for_timestamp = true
bulk_insert_buffer_size = 8M
connect_timeout = 10
interactive_timeout = 50
user = mysql
query_cache_type = 0
#query_cache_limit =
query_cache_min_res_unit = 2k
query_cache_size = 0
table_open_cache = 2048
#ft_min_word_len =
# Skip reverse DNS lookup of clients
# skip-name-resolve
thread_stack = 256K
transaction_isolation = REPEATABLE-READ
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
table_open_cache = 4096
join_buffer_size = 8M
key_buffer_size = 256M
max_allowed_packet = 16M
read_buffer_size = 2M
bulk_insert_buffer_size = 64M
default_storage_engine = InnoDB
myisam_recover_options = BACKUP,FORCE
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 5G
myisam_repair_threads = 4
myisam-recover-options
thread_cache_size = 10
#thread_concurrency = 8
max_heap_table_size = 512M
tmp_table_size = 512M
wait_timeout = 300
innodb_large_prefix = true
innodb_file_format = barracuda
innodb_file_format_max = barracuda
innodb_file_per_table = 1
innodb_buffer_pool_size = 4G
innodb_buffer_pool_instances = 4
#innodb_buffer_pool_dump_at_shutdown = 1
#innodb_buffer_pool_load_at_startup = 1
innodb_flush_method = O_DIRECT
#innodb_adaptive_flushing = 1
innodb_io_capacity = 420
innodb_read_io_threads = 8
innodb_thread_concurrency = 16
innodb_write_io_threads = 8
innodb_log_file_size = 512M
innodb_fast_shutdown = 1
#innodb_additional_mem_pool_size = 16M
innodb_data_file_path = ibdata1:10M:autoextend
innodb_flush_log_at_trx_commit = 0
innodb_log_buffer_size = 8M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
#log-queries-not-using-indexes = 1
# Error log
log_error = /var/lib/mysql/panel.uhlhosting.ch.err
binlog_cache_size = 1M
binlog_format = ROW
max_binlog_size = 100M
# Slow Query Log
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 1
slow_query_log = ON
# General Log
general_log_file = /var/log/mysql/general.log
pid-file = /var/lib/mysql/panel.uhlhosting.ch.pid
expire_logs_days = 7
[mysqld_safe]
nice = 0
open_files_limit = 8192
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer_size = 16M
write_buffer = 16M
[mysqldump]
# Do not buffer the whole result set in memory before writing it to
# file. Required for dumping very large tables
quick
quote-names
max_allowed_packet = 16M
[mysql]
#character-set-server=utf8
no-auto-rehash
# Only allow UPDATEs and DELETEs that use keys.
#safe-updates
[isamchk]
key_buffer = 16M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment