MySQL配置文件模板

[client]
#default-character-set=latin1
no-auto-rehash
port            = 3306
socket          = /tmp/mysql-3306.sock
[mysql]
#default-character-set=latin1
prompt=mysql--\\u@\\h:\\d \\R:\\m:\\s>>
skip-reconnect
[mysqld]
character-set-server=latin1
skip-character-set-client-handshake
log-error        = mysql.err
pid-file         = mysql.pid
#general_log_file    = general.log
port                     = 3306
datadir                  = /home/mysql/data-2-6-adb-3306
basedir                  = /usr/local/mysql5.1 
tmpdir                   = /home/mysql/log-2-6-adb-3306
slave-load-tmpdir        = /home/mysql/log-2-6-adb-3306
socket                   = /tmp/mysql-3306.sock
skip-external-locking
#key_buffer = 384M
#32bit系统下有可能导致innodb_buffer_pool_size不能设置为2G,所以减小key_buffer到340M
key_buffer = 340M
max_allowed_packet       = 64M
table_cache              = 600
join_buffer_size         = 8M
sort_buffer_size         = 8M
read_buffer_size         = 2M
read_rnd_buffer_size     = 4M
myisam_sort_buffer_size  = 8M
#query_cache_type        = 0
query_cache_size         = 32M
#query_cache_limit        = 16M
max_tmp_tables           = 128
tmp_table_size           = 32M
max_heap_table_size      = 32M
thread_cache             = 8
thread_concurrency       = 8
#max_connections=600
#问道adb数据库的连接数基本都在300一下,所以把最大连接数减小到500
max_connections=500
max_user_connections     = 259
max_connect_errors       = 99999999
wait_timeout             = 2880000
interactive_timeout      = 2880000
back_log                 = 50
myisam_repair_threads    = 1
myisam-recover           = DEFAULT
old_passwords=1
bulk_insert_buffer_size = 16M
default-storage-engine  = innodb
#innodb_data_home_dir    = /home/mysql/data-2-6-adb-3306
innodb_data_file_path   = ibdata1:128M:autoextend
#innodb_log_group_home_dir = /home/mysql/data-2-6-adb-3306
innodb_file_per_table   = 1
innodb_buffer_pool_size = 2G
innodb_additional_mem_pool_size = 16M
innodb_log_file_size     = 128M
innodb_log_files_in_group = 3
innodb_log_buffer_size   =16M
innodb_lock_wait_timeout = 50
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_thread_concurrency = 32
skip-name-resolve
innodb_support_xa = 0
##############################################################
slave-skip-errors=1062,1205
log-slave-updates
binlog_format=STATEMENT
expire_logs_days = 3
sync_binlog = 0
server-id=1
log-bin   =/home/mysql/log-2-6-adb-3306/binlog/mysql-bin
relay-log =/home/mysql/log-2-6-adb-3306/relaylog/mysql-relay-bin
slave-skip-errors=1062,1205
max_binlog_size = 500M
binlog_cache_size = 128K
#############################################################333333
#add slow query
long_query_time = 8
slow_query_log=slow.log
[myisamchk]
key_buffer = 256M
sort_buffer_size = 128M
read_buffer = 8M
write_buffer = 8M


你可能感兴趣的:(mysql,配置文件)