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 ''bc 1024^2 * <num MB>''
 +
 +**Set key_buffer_size to 16MB**
 +
 +<code>
 +SET GLOBAL key_buffer_size = 16777216;
 +</code>
 +
 +**Set max_allowed_packet to 1MB**
 +
 +<code>
 +SET GLOBAL max_allowed_packet = 1048576;
 +</code>
 +
 +**Set myisam_sort_buffer_size to 64MB**
 +<code>
 +SET @@myisam_sort_buffer_size = 67108864;
 +</code>
 +
 +
 +==== Default Configuration Files ====
 +
 +== Small ==
 +
 +<code>
 +# 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't use much resources.
 +
 +[mysqld]
 +port            = 3306
 +socket          = /var/run/mysqld/mysqld.sock
 +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       = 1
 +</code>
 +
 +== Medium ==
 +
 +<code>
 +# 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          = /var/run/mysqld/mysqld.sock
 +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       = 1
 +</code>
 +
 +== Large ==
 +
 +<code>
 +# This is for a large system with memory = 512M where the system runs mainly
 +# MySQL.
 +
 +[mysqld]
 +port            = 3306
 +socket          = /var/run/mysqld/mysqld.sock
 +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       = 1
 +</code>
 +
 +== Default ==
 +
 +<code>
 +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
 +</code>

Navigation
QR Code
QR Code mysql_configuration (generated for current page)