Skip to content

Instantly share code, notes, and snippets.

@pvgomes
Created June 24, 2016 20:03
Show Gist options
  • Save pvgomes/7b03ab4bb23ed4fc6160841c52307c27 to your computer and use it in GitHub Desktop.
Save pvgomes/7b03ab4bb23ed4fc6160841c52307c27 to your computer and use it in GitHub Desktop.
#
# 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]
nice = 0
socket = /var/run/mysqld/mysqld.sock
[mysqld]
#
# * Basic Settings
#
user = mysql
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
default-time-zone = 'America/Sao_Paulo'
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
lc-messages-dir = /usr/share/mysql
log_error = /var/log/mysql/error.log
max_heap_table_size = 32M
query_cache_type = 1
table_definition_cache = 1024
thread_concurrency = 3
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
#
# * Fine Tuning
#
#key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 50
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
expire_logs_days = 1
max_binlog_size = 100M
#
# * 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!
#
# * Security Features
#
# http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html
innodb_buffer_pool_size = 512M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT # See open(2) for O_DIRECT info.
innodb_log_file_size = 128M
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 2
innodb_file_per_table = 0
# Server system variables
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
# key_buffer_size = 128M
max_connections = 50
open_files_limit = 16384
query_cache_limit = 256k
query_cache_size = 80M
read_rnd_buffer_size = 8M
sort_buffer_size = 12M
table_open_cache = 4096
thread_cache_size = 64
tmp_table_size = 256M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
#key_buffer_size = 16M
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment