Differences
This shows you the differences between two versions of the page.
— | mysql_configuration [2015/06/01 22:55] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== MySQL Configuration ====== | ||
+ | * [[MySQL]] | ||
+ | * [[MySQL Character Sets]] | ||
+ | * [[MySQL Logs]] | ||
+ | * [[MySQL Optimization]] | ||
+ | |||
+ | ==== Update Runtime Configuration ==== | ||
+ | |||
+ | For MB sizes, use '' | ||
+ | |||
+ | **Set key_buffer_size to 16MB** | ||
+ | |||
+ | < | ||
+ | SET GLOBAL key_buffer_size = 16777216; | ||
+ | </ | ||
+ | |||
+ | **Set max_allowed_packet to 1MB** | ||
+ | |||
+ | < | ||
+ | SET GLOBAL max_allowed_packet = 1048576; | ||
+ | </ | ||
+ | |||
+ | **Set myisam_sort_buffer_size to 64MB** | ||
+ | < | ||
+ | SET @@myisam_sort_buffer_size = 67108864; | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Default Configuration Files ==== | ||
+ | |||
+ | == Small == | ||
+ | |||
+ | < | ||
+ | # This is for a system with little memory (<= 64M) where MySQL is only used | ||
+ | # from time to time and it's important that the mysqld daemon | ||
+ | # doesn' | ||
+ | |||
+ | [mysqld] | ||
+ | port = 3306 | ||
+ | socket | ||
+ | skip-locking | ||
+ | key_buffer_size = 16K | ||
+ | max_allowed_packet = 1M | ||
+ | table_open_cache = 4 | ||
+ | sort_buffer_size = 64K | ||
+ | read_buffer_size = 256K | ||
+ | read_rnd_buffer_size = 256K | ||
+ | net_buffer_length = 2K | ||
+ | thread_stack = 128K | ||
+ | server-id | ||
+ | </ | ||
+ | |||
+ | == Medium == | ||
+ | |||
+ | < | ||
+ | # This is for a system with little memory (32M - 64M) where MySQL plays | ||
+ | # an important part, or systems up to 128M where MySQL is used together with | ||
+ | # other programs (such as a web server) | ||
+ | |||
+ | [mysqld] | ||
+ | port = 3306 | ||
+ | socket | ||
+ | skip-locking | ||
+ | key_buffer_size = 16M | ||
+ | max_allowed_packet = 1M | ||
+ | table_open_cache = 64 | ||
+ | sort_buffer_size = 512K | ||
+ | net_buffer_length = 8K | ||
+ | read_buffer_size = 256K | ||
+ | read_rnd_buffer_size = 512K | ||
+ | myisam_sort_buffer_size = 8M | ||
+ | log-bin=mysql-bin | ||
+ | binlog_format=mixed | ||
+ | server-id | ||
+ | </ | ||
+ | |||
+ | == Large == | ||
+ | |||
+ | < | ||
+ | # This is for a large system with memory = 512M where the system runs mainly | ||
+ | # MySQL. | ||
+ | |||
+ | [mysqld] | ||
+ | port = 3306 | ||
+ | socket | ||
+ | skip-locking | ||
+ | key_buffer_size = 256M | ||
+ | max_allowed_packet = 1M | ||
+ | table_open_cache = 256 | ||
+ | sort_buffer_size = 1M | ||
+ | read_buffer_size = 1M | ||
+ | read_rnd_buffer_size = 4M | ||
+ | myisam_sort_buffer_size = 64M | ||
+ | thread_cache_size = 8 | ||
+ | query_cache_size= 16M | ||
+ | thread_concurrency = 8 | ||
+ | log-bin=mysql-bin | ||
+ | binlog_format=mixed | ||
+ | server-id | ||
+ | </ | ||
+ | |||
+ | == Default == | ||
+ | |||
+ | < | ||
+ | key_buffer_size = 8M | ||
+ | max_allowed_packet = 1M | ||
+ | table_open_cache = 64 | ||
+ | sort_buffer_size = 2M | ||
+ | read_buffer_size = 128K | ||
+ | read_rnd_buffer_size = 256K | ||
+ | myisam_sort_buffer_size = 8M | ||
+ | thread_cache_size = 0 | ||
+ | query_cache_size= 0 | ||
+ | thread_concurrency = 10 | ||
+ | </ |