MySQL典型配置
# The following options will be passed to all MySQL clients[client]#password = your_passwordport = 3306socket = /tmp/mysql.sock# The MySQL server[mysqld]port = 3306socket = /tmp/mysql.sock# 避免MySQL的外部锁定,减少出错几率增强稳定性skip-lockingbind-address = 172.30.6.2datadir = /data/dbdata# 每个表使用不同的数据文件innodb_file_per_table# 同步时跳过mysql数据库replicate-ignore-db = mysql# 缺省使用innodb表类型default-table-type = innodb# 缺省使用gbk字符集default-character-set=gbk#最大连接数限制为100个max_connections = 100# 每个连接独立使用的内存为 sort_buffer_size+read_buffer_size+join_buffer_sizesort_buffer_size = 4Mread_buffer_size = 2M# 关闭自动提交选项init_connect='set autocommit=0'# 开启慢查询日志, 仅对select操作有效, 包括不使用索引的查询.log_slow_queries# 超过此时间的查询被视为慢查询, 单位 秒.long_query_time = 3# 最大包的大小max_allowed_packet = 16M# key_buffer_size 仅对myisam表有效. 但由于mysql的临时表/系统表都是myisam,因此需要设置.key_buffer_size = 32Mtable_cache = 512read_rnd_buffer_size = 8Mmyisam_sort_buffer_size = 64Mthread_cache_size = 8query_cache_size = 32M# Try number of CPU's*2 for thread_concurrencythread_concurrency = 8# InnoDB的配置innodb_data_home_dir = /data/dbdata/innodbinnodb_data_file_path = ibdata1:1000M;ibdata2:100M:autoextendinnodb_log_group_home_dir = /data/dbdata/innodbinnodb_log_arch_dir = /data/dbdata/innodbinnodb_buffer_pool_size = 1Ginnodb_additional_mem_pool_size = 20M# innodb_log_file_size 设置成innodb_buffer_pool_size的25%innodb_log_file_size = 250M# InnoDB用来往磁盘上的日志文件写操作的缓冲区的大小。明智的值是从1MB到8MB。innodb_log_buffer_size = 8M# 关闭实时刷新事务日志的功能,非常影响insert的性能. 关闭后,mysql仍然会每秒钟刷新一次.innodb_flush_log_at_trx_commit = 0innodb_lock_wait_timeout = 50# 关闭XA事务innodb_support_xa = 0[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehash# Remove the next comment character if you are not familiar with SQL#safe-updates[isamchk]key_buffer = 256Msort_buffer_size = 256Mread_buffer = 2Mwrite_buffer = 2M[myisamchk]key_buffer = 256Msort_buffer_size = 256Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeout