文章浏览 复制本页面地址

Linux Mysql__my.cnf配置优化

[client]
#password   = [your_password]
port        = 3306
socket      = /var/lib/mysql/mysql.sock
default-character-set = utf8

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set = utf8
skip-locking
key_buffer = 16M
max_allowed_packet = 24M
table_cache = 64
sort_buffer_size = 2M
net_buffer_length = 8K
read_buffer_size = 4M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 8M
interactive_timeout=28800000
wait_timeout=28800000
max_connections = 10000
skip-federated
#log-bin=mysql-bin
server-id  = 1

innodb_flush_log_at_trx_commit=0
back_log = 1024
open_files_limit   = 4096
max_connect_errors = 1024
join_buffer_size   = 4M
query_cache_limit  = 2M
query_cache_size   = 400M
thread_cache_size  = 1200
thread_stack       = 1M
tmp_table_size     = 256M
max_tmp_tables     = 256
binlog_cache_size  = 2M
long_query_time    = 1
innodb_log_buffer_size = 100M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

 

 

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

标签:
上一篇:
下一篇: