มาปรับแต่ง MySQL ให้เร็วแรงสเถียร

ด้านล่างนี้เป็นตัวอย่างการตั้งค่าไฟล์ /etc/my.cnf

[mysqld]localinfile=0
#skip-innodb innodb_buffer_pool_size=256M
#innodb_additional_mem_pool_size=4M
innodb_log_buffer_size
=2M
innodb_flush_log_at_trx_commit
= 1
innodb_thread_concurrency
=2
#innodb_log_file_size = 256M
innodb_file_per_table
skip
charactersetclienthandshake
skip
nameresolve max_connections = 300
key_buffer
= 512M
myisam_sort_buffer_size
= 32M
join_buffer_size
= 1M
read_buffer_size
= 1M
sort_buffer_size
= 2M
read_rnd_buffer_size
= 1M
table_cache
= 1536
thread_cache
= 4
thread_concurrency
= 2
thread_cache_size
= 256
wait_timeout
= 3600
connect_timeout
= 10
max_tmp_tables
= 256
tmp_table_size
= 128M
max_allowed_packet
= 16M
max_connect_errors
= 10
query_cache_limit
= 1M
query_cache_size
= 32M
query_cache_type
= 1
query_prealloc_size
= 16384
query_alloc_block_size
= 16384
max_heap_table_size
= 128M
#tmpdir=/var/mysqltmp
log_warnings
=0

[mysqld_safe]
log
error=/var/log/mysqld.log
pidfile=/var/run/mysqld/mysqld.pid
open_files_limit = 16384

 

 

 

ที่มา  http://host4.pro/general/hosting/วิธีปรับแต่ง-mysql-ในlinuxเร็ว/