Skip to content

Instantly share code, notes, and snippets.

@amr
Last active September 30, 2020 17:46
Show Gist options
  • Save amr/67dbf4cd9f725b9836d0 to your computer and use it in GitHub Desktop.
Save amr/67dbf4cd9f725b9836d0 to your computer and use it in GitHub Desktop.
MySQL my.cnf settings optimized for local development, this is NOT a complete my.cnf configuration, the settings here are meant to be copied from their sections and pasted in the appropriate section in an existing working my.cnf
[mysqld]
open-files-limit = 24000
character-set-server = utf8
character-set-filesystem = utf8
#
# InnoDB
#
# After applying these for the first time on a new mysql installation with no
# existing data, you should stop mysql, remove existing ib data and ib log files
# then start mysql, this command removes such files (adjust base path accordingly):
#
# $: rm /var/lib/mysq/ib{data,_logfile}*
#
# If you have existing data, then you should comment out the following options
# so that InnoDB can start: innodb_file_per_table, innodb_log_file_size, innodb_data_file_path
#
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table = 1
innodb_buffer_pool_size = 1G # The most important variable here
innodb_additional_mem_pool_size = 20M
innodb_log_file_size = 100M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_flush_method = O_DIRECT
innodb_thread_concurrency = 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment