Skip to content

Instantly share code, notes, and snippets.

@adampielak
Forked from lesstif/my.cnf
Created June 2, 2020 22:01
Show Gist options
  • Select an option

  • Save adampielak/cf54ea55289d47474a935a5dbe2d1599 to your computer and use it in GitHub Desktop.

Select an option

Save adampielak/cf54ea55289d47474a935a5dbe2d1599 to your computer and use it in GitHub Desktop.
mysql configuration for Linux distro
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysql]
local_infile=true
[mysqld]
local_infile=true
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
skip-character-set-client-handshake
default-time-zone='+9:00'
innodb_large_prefix=on
innodb_file_format=barracuda
innodb_file_per_table=true
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 2G
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
# Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208
# # Configuration name kccf-dev generated for [email protected] at 2018-04-20 15:47:53
#
#
# # GENERAL #
# user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid
#
# # MyISAM #
# key-buffer-size = 32M
# myisam-recover-options = FORCE,BACKUP
#
# # SAFETY #
max-allowed-packet = 512M
# max-connect-errors = 1000000
#
# # DATA STORAGE #
datadir = /var/lib/mysql/
#
# # BINARY LOGGING #
# log-bin = /var/lib/mysql/mysql-bin
# expire-logs-days = 14
# sync-binlog = 1
#
# # CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 500
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 1024
table-open-cache = 2048
##
# # INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 512M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 26G
#
# # LOGGING #
log-error = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
validate_password_policy=LOW
default_password_lifetime=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment