File: //etc/my.cnf
[mysqld]
log-error=/var/lib/mysql/mysql.err
performance-schema = 0
default-storage-engine = InnoDB
innodb_file_per_table = 1
# InnoDB Settings
innodb_buffer_pool_size = 36G
innodb_buffer_pool_instances = 12
innodb_log_file_size = 2G
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
# Connections
max_connections = 300
max_user_connections = 50
interactive_timeout = 60
wait_timeout = 60
connect_timeout = 10
thread_cache_size = 256
# Cache Settings
table_open_cache = 20000
table_definition_cache = 10000
# Buffers
sort_buffer_size = 4M
read_buffer_size = 2M
join_buffer_size = 8M
key_buffer_size = 64M
# Temp Tables
tmp_table_size = 256M
max_heap_table_size = 256M
# Files
open_files_limit = 65535
# SQL Mode (Safe defaults)
sql-mode = "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_allowed_packet=268435456
plugin-load-add=auth_socket.so
unix_socket=OFF
[mysqldump]
quick
max_allowed_packet = 512M
lock-tables = FALSE
[mysql]
no-auto-rehash
[client]
socket = "/var/lib/mysql/mysql.sock"