以下是512m內(nèi)存 linux vps中的mysql配置,各個(gè)參數(shù)的意義朋友們可以百度下。
配置文件:/etc/my.cnf,配置僅供參考。
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 24m
sort_buffer_size = 512k
read_buffer_size = 2m
read_rnd_buffer_size = 4m
join_buffer_size = 256k
thread_cache_size = 10
query_cache_size = 1m
query_cache_limit = 2m
query_cache_min_res_unit = 4k
thread_concurrency = 2
table_cache = 720
table_open_cache = 720
open_files_limit = 1000
back_log = 80
max_connections = 100
max_connect_errors = 200
external-locking = false
max_allowed_packet = 16m
default-storage-engine = innodb
thread_stack = 192k
transaction_isolation = read-committed
tmp_table_size = 4m
max_heap_table_size = 32m
bulk_insert_buffer_size = 4m
myisam_sort_buffer_size = 8m
myisam_max_sort_file_size = 10g
myisam_repair_threads = 1
myisam_recover
server-id = 1
[mysqldump]
quick
max_allowed_packet = 32m
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20m
sort_buffer_size = 20m
read_buffer = 2m
write_buffer = 2m
[mysqlhotcopy]
interactive-timeout