mysql的配置
mysql的运营配置:连接字符串、连接数、连接时间、处理线程数最大值、处理线程数最小值、主从配置、日志、innodb的buffer_cache、内存中的临时表大小等信息。
[client]port = 3306[mysqld]basedir=/usr/local/mysqldatadir=/usr/local/mysql/data#配置此项可以追踪sql执行记录log=/usr/local/mysql/log/mysql-sql.log##以下为开启主从的必要配置server-id = 1log_bin = /usr/local/mysql/data/log/mysql-bin.log #日志名字binlog-do-db=db_nameA #指定对db_nameA记录二进制日志 binlog-ignore-db=db_namB #指定不对db_namB记录二进制日志expire_logs_days = 30 #存活30天character-set-server = utf8 #服务器的字符集default-storage-engine = InnoDB #默认启动InnoDB服务器#connection(连接)max_connections = 1024max_connect_errors = 1024# Try number of CPU's*2 for thread_concurrency(线程:CPU个数的2倍)thread_concurrency = 8 #保留线程thread_cache_size = 256 #线程池#*networkskip-name-resolvemax_allowed_packet = 1M#buffer(表缓存、join查询缓存)table_open_cache = 4096sort_buffer_size = 256Kjoin_buffer_size = 256K#query cache(查询缓存)query_cache_limit = 4Mquery_cache_size = 4Mquery_cache_type = 1#temptable(内存中的临时表)tmp_table_size = 64Mmax_heap_table_size = 64M#Innodb(主要)innodb_buffer_pool_size = 5Ginnodb_log_file_size = 256Minnodb_log_files_in_group = 2innodb_status_file = 1innodb_additional_mem_pool_size = 32Minnodb_data_file_path = ibdata1:1G:autoextendinnodb_file_per_table = 1innodb_additional_mem_pool_size = 32Minnodb_buffer_pool_size = 5Ginnodb_data_file_path = ibdata1:1G:autoextendinnodb_file_per_table = 1innodb_force_recovery = 0#innodb_table_locksinnodb_thread_concurrency = 8innodb_flush_log_at_trx_commit = 2innodb_force_recovery = 0#innodb_table_locksinnodb_thread_concurrency = 8innodb_flush_log_at_trx_commit = 2#slow logslow_query_log=1long_query_time=1slow_query_log_file=/var/lib/mysql/log/slow.log[mysqld_safe]#error loglog-error = /usr/local/mysql/log/mysqld.logopen-files-limit = 40960 #(文件描述符)[mysqldump]max_allowed_packet = 48M