mysql优化

19195.cn  手游网站mysql 优化一:

 

vi  /etc/my.cnf

 

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

character-set-server=utf8

 

key_buffer_size = 256M

max_allowed_packet = 4M

thread_stack = 256K

table_cache = 128K

sort_buffer_size = 6M

read_buffer_size = 4M

join_buffer_size = 8M

myisam_sort_buffer_size = 64M

table_cache = 512

thread_cache_size = 64

query_cache_size = 64M

tmp_table_size = 256M

max_connections = 768

max_connect_errors = 10000000

wait_timeout = 10

thread_concurrency = 8

 

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

 

你可能感兴趣的:(mysql优化)