[client]
port =
socket = /var/run/mysqld/mysqld.sock [mysqld_safe]
thp-setting=never
socket = /var/run/mysqld/mysqld.sock
nice = [mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port =
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp local-infile =
lc-messages-dir = /usr/share/mysql
skip-external-locking
skip-name-resolve #bind-address = 127.0.0.1 #对timestamp新的行为控制参数,相关文章
explicit_defaults_for_timestamp = character-set-server = utf8mb4
default-storage-engine=INNODB ##thread相关参数:Thread_pool_size X Thread_pool_oversubscribe = MySQL内部同时支持运行的最大任务数,相关文章
#MySQL线程调度方式,
thread_handling = pool-of-threads
#根据系统的CPU创建出thread_pool_size(该参数不建议调整)threadpool中group数量,默认为cpu核心数,server启动时自动计算
#thread_pool_size = auto
#每个thread_pool_size里同时可以运行多少个任务,超过限制后,继续创建worker线程会被延迟
thread_pool_oversubscribe =
#timer线程检测间隔,单位为毫秒,用于防止thread pool里的线程死掉.Thread pool里线程如果超过thread_pool_stall_limit声明的时间没响应降会重新创建
thread_pool_stall_limit =
#用于声明extra_port最大允许的连接,extra_port 去监听一个和服务端口不一样的端口,用于Thread pool被占满或是被锁着的情况下用于管理使用.
extra_max_connection =
#线程池的优先级:transactions:使用优先队列和普通队列,对于事务已经开启的statement,放到优先队列中,否则放到普通队列中。statements:只使用优先队列
;none: 只是用普通队列,本质上和statements相同,都是只是用一个队列
thread_pool_high_prio_mode = transactions
#当开启了优先队列模式后,每个连接最多允许thread_pool_high_prio_tickets次被放到优先队列中,之后放到普通队列中
thread_pool_high_prio_tickets=4294967295
#线程最大空闲时间,单位为秒,超过限制后会退出,默认60
thread_pool_idle_timeout=
#threadpool中最大线程数目,线程总数超过该限制后不能继续创建更多线程
thread_pool_max_threads = #FullText
#MyISAM
ft_min_word_len =
ft_max_word_len =
#InnoDB
innodb_ft_min_token_size=
innodb_ft_max_token_size= #MyISAM 停止词存放在文件
ft_stopword_file = /var/lib/mysql/stopword.txt #InnoDB,停止词存放在表
innodb_ft_server_stopword_table = dba_test/ft_stopwords
innodb_ft_user_stopword_table = dba_test/ft_stopwords #控制在创建临时表时使用的存储引擎,默认为innodb
default_tmp_storage_engine = innodb #线上可以开启
innodb_undo_directory = /var/lib/mysql/undolog/
innodb_undo_tablespaces =
innodb_undo_logs = #用于优化in(),以确认是否直接使用索引统计,相关文章
eq_range_index_dive_limit = #back_log =
thread_stack = 192K max_allowed_packet = 32M
max_connections =
max_connect_errors =
max_heap_table_size = 256M
max_length_for_sort_data=
tmp_table_size = 256M read_buffer_size = 512K
read_rnd_buffer_size = 1M
sort_buffer_size = 512K
join_buffer_size = 256K table_open_cache =
#对table cache进行划分,减少table cache的锁竞争,累死innodb_buffer_poll_instances
table_open_cache_instances =
thread_cache_size = # * Query Cache Configuration
#query_cache_type =
#query_cache_size = 0M
#query_cache_limit = 1M open_files_limit = # * Logging and Replication
log_error = /var/log/mysql/error_3306.log
#开启慢查询日志,相关文章1文章2
slow_query_log =
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 0.5
#log-queries-not-using-indexes
#general_log =
#慢查询过滤器,用于Percona,相关文章
#log_slow_filter = 'string'
#可用值session or query
log_slow_rate_type = session
#记录每个session/query的日志,如果log_slow_rate_type为session,将不记录replication thread的日志
log_slow_rate_limit =
#语句执行存储过程(不包括触发器)慢将记录到慢查询日志
log_slow_sp_statements =
#指定慢查询日志包含多少信息,相关文章
#log_slow_verbosity = ''
#每个慢查询记录时间戳
#slow_query_log_timestamp_always
#精度为second或microsecond
slow_query_log_timestamp_precision=second
#该变量控制最大slow文件数量,设置slow_query_log_file为没有.log后缀的文件
#max_slowlog_files
#超过该值,slow日志将自动旋转,生成slow_query_log_file.000001这样的文件
#max_slowlog_size log_bin = mysql-bin-.log
binlog_cache_size = 1M
max_binlog_size = 1024M
binlog_format = MIXED
#binlog_format = ROW
#binlog_row_image = minimal
#binlog_rows_query_log_events = 1
sync_binlog =
expire_logs_days =
#binlog_checksum         = NONE
#事务提交顺序和binlog记录顺序是相同的,默认打开
binlog_order_commits    =1
server-id               = 

relay_log                = mysqld-relay-bin

# * TokuDB
tokudb_cache_size = 512M
tokudb_commit_sync =
tokudb_fsync_log_period =
tokudb_data_dir = /var/lib/mysql/tokudb_data
tokudb_log_dir = /var/lib/mysql/tokudb_log
tokudb_tmp_dir = /tmp # * MyISAM
key_buffer_size = 128M
bulk_insert_buffer_size = 8M
concurrent_insert =
#myisam-recover = BACKUP
myisam_recover_options = BACKUP # * InnoDB
#打印死锁到errorlog
innodb_print_all_deadlocks = 1

#预读,对于随机读写,推荐关闭
  innodb_read_ahead_threshold = 0

#预热
innodb_buffer_pool_dump_now =
innodb_buffer_pool_load_now = innodb_buffer_pool_dump_at_shutdown =
innodb_buffer_pool_load_at_startup =
#预热文件
innodb_buffer_pool_filename =
ib_buffer_pool

#事务日志记录的大小,默认512,ssd可以设置4096
  innodb_log_block_size = 4096

innodb_page_size                = 16K
#innodb_page_size = 4K #ssd
#innodb_flush_neighbors =
#ssd
innodb_flush_neighbors =
#影响page cleaner 线程一次扫描LRU/UNZIP_LRU的深度,默认为1024,IO能力强的可以适当调大。 innodb_io_capacity/innodb_buffer_pool_instances
innodb_lru_scan_depth = innodb_strict_mode =
innodb_buffer_pool_size = 10000M
innodb_buffer_pool_instances =
innodb_change_buffering = all
innodb_change_buffer_max_size =
innodb_autoextend_increment =
innodb_additional_mem_pool_size = 15M#5.7中移除,innodb_use_sys_malloc 配置为 ON 时,innodb_additional_mem_pool_size 失效(直接从操作系统分配内存)
innodb_file_per_table =
innodb_flush_log_at_trx_commit =
#自定义刷新日志时间,每隔这么多秒刷一次日志,只有在innodb_flush_log_at_trx_commit=2时才生效
innodb_flush_log_at_timeout
= innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group =
innodb_max_dirty_pages_pct = innodb_read_io_threads =
innodb_write_io_threads = #innodb_io_capacity =
innodb_io_capacity = #ssd
#innodb_io_capacity_max = innodb_adaptive_flushing =
innodb_adaptive_flushing_lwm = innodb_old_blocks_pct =
innodb_old_blocks_time
=
#online ddl时并发DML产生的row log最大size,超过这个限制会导致DDL回滚
innodb_online_alter_log_max_size = 128M innodb_flush_neighbors = innodb_concurrency_tickets =
innodb_optimize_fulltext_only = innodb_use_native_aio =
innodb_use_sys_malloc = 1#innodb_use_sys_malloc 配置为 ON 时,innodb_additional_mem_pool_size 失效(直接从操作系统分配内存)。5.7中移除
innodb_thread_concurrency = #回收undo线程
innodb_purge_threads=
#5.7

#innodb_page_cleaners
= 4
#每次回收undo页的数量
innodb_purge_batch_size
=
#创建索引做merge-sort时,一个归并block的大小
innodb_sort_buffer_size = 16M innodb_change_buffering = all
#changebuffer占用bp的最大比例
innodb_change_buffer_max_size = innodb_file_format = barracuda
innodb_file_format_check =
innodb_file_format_max = barracuda
innodb_stats_on_metadata = innodb_open_files =
#Percona支持ALL_O_DIRECT
innodb_flush_method = ALL_O_DIRECT
#innodb_flush_method = O_DIRECT_NO_FSYNC lock_wait_timeout = transaction-isolation = READ-COMMITTED # * replication
replicate-ignore-db = test
replicate-ignore-db = mysql
#binlog_do_db = include_database_name
skip-slave-start =
log_slave_updates = #gtid-mode=on # GTID only
#enforce-gtid-consistency=true # GTID only master_info_repository = table
relay_log_info_repository = table # * slave #并行复制线程数
slave_parallel_workers =
#多线程复制需要关闭
slave_transaction_retries =
#在并发复制时总共执行这么多次事务后做一次checkpoint,更新show slave status的数据
slave_checkpoint_group =
#在复制执行这么长时间后做一次checkpoint
slave_checkpoint_period =
#在多线程复制时,在队列中Pending的事件所占用的最大内存,默认为16M,如果内存富余,或者延迟较大时,可以适当调大;注意这个值要比主库的max_allowed_packet大
slave_pending_jobs_size_max = 32M
#备库SQL线程是否检查binlog的checksum
slave_sql_verify_checksum =
#部分解决无主键表导致的复制延迟问题,相关文章
#slave_rows_search_algorithms = TABLE_SCAN,INDEX_SCAN,HASH_SCAN
#slave_net_timeout =
relay_log_recovery =
#sync_relay_log =
#sync_relay_log_info =
#sync_master_info = # ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem [mysqldump]
quick
quote-names
max_allowed_packet = 16M [mysql]
#no-auto-rehash # faster start of mysql but no tab completition [isamchk]
key_buffer = 16M #
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

该文章后续会不断更新,慢慢完善。之前也介绍了MySQL5.5的配置文件,现在按照前2篇文章1文章2的信息,整理出该博文。对MySQL5.6的my.cnf 进行了配置(Percona MySQL),因为根据服务器硬件资源来调整的,所以一些内存、io刷写的大小比例可以根据自己的条件来设置。

相关文章:

http://mysqllover.com/?p=575

http://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html

https://www.percona.com/doc/percona-server/5.6/ps-versions-comparison.html

https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html

MySQL 5.6 my.cnf 模版的更多相关文章

  1. 类Unix如何查看mysql的配置文件my.cnf

    mysql 配置文件 my.cnf是MySQL启动时加载的配置文件,一般会放在MySQL的安装目录中,用户也可以放在其他目录加载. 安装MySQL后,系统中会有多个my.cnf文件,有些是用户测试的. ...

  2. Mysql 之配置文件my.cnf

    mysql配置文件为my.cnf,它所在位置根据安装时设定的. 当mysqld服务启动的时候,默认会按一定的顺序读取配置文件的. 1 2 3 [root@zhu2 ~]# /opt/mysql/lib ...

  3. 查找MySql的配置文件my.cnf所在路径

    Linux系统 linux 上可以使用 mysql --help|grep my.cnf 过滤查看 [root@localhost etc]# mysql --help|grep my.cnf ord ...

  4. MySQL优化性能my.cnf详解

    提供一个MySQL 5.6版本适合在1GB内存VPS上的my.cnf配置文件(点击这里下载文件): [client] port=3306 socket=/tmp/mysql.sock [mysqld] ...

  5. mysql的配置文件my.cnf

    调整MySQL运行参数,修改/etc/my.cnf文件调整mysql运行参数重启MySQL后生效,在MySQL4版本以后,一部分内部变量可以在MySQL运行时设置,不过重启MySQL就失效了. mys ...

  6. mysql主配置文件my.cnf详细说明

    MySQL配置文件my.cnf 例子最详细翻译,可以保存做笔记用[转载]#BEGIN CONFIG INFO#DESCR: 4GB RAM, 只使用InnoDB, ACID, 少量的连接, 队列负载大 ...

  7. Docker安装MySQL并配置my.cnf

    1.创建一个临时的mysql,以便复制出my.cnf等数据 $ docker run --restart=always -d -v /opt/data/mysql/:/var/lib/mysql -p ...

  8. mysql 修改配置文件my.cnf失败

    一.连接Mysql提示无法通过socket的解决方法连接到本地MySQL服务器 http://www.aiezu.com/db/mysql_cant_connect_through_socket.ht ...

  9. Linux下MySql的配置文件my.cnf详细 讲解

    经常在使用MySql,但是对于MySql下面的各种参数的配置并不是很熟悉,经常在需要改变某项参数的时候,还要到处在网上查找,有点不方便.今天想把MySql下面的配置文件my.cnf详细的做一个说明(L ...

随机推荐

  1. Makefile的学习笔记

    Makefile的学习笔记 标签: makefilewildcard扩展includeshellfile 2012-01-03 00:07 9586人阅读 评论(2) 收藏 举报  分类: Linux ...

  2. 简单实用的PHP防注入类实例

    这篇文章主要介绍了简单实用的PHP防注入类实例,以两个简单的防注入类为例介绍了PHP防注入的原理与技巧,对网站安全建设来说非常具有实用价值,需要的朋友可以参考下   本文实例讲述了简单实用的PHP防注 ...

  3. 用一个简单的例子来理解python高阶函数

    ============================ 用一个简单的例子来理解python高阶函数 ============================ 最近在用mailx发送邮件, 写法大致如 ...

  4. 清北学堂模拟day6 圆桌游戏

    [问题描述] 有一种圆桌游戏是这样进行的:n个人围着圆桌坐成一圈,按顺时针顺序依次标号为1号至n号.对1<i<n的i来说,i号的左边是i+1号,右边是i-1号.1号的右边是n号,n号的左边 ...

  5. Hadoop Fsimage 和 editlog

    在<Hadoop NameNode元数据相关文件目录解析>文章中提到NameNode的$dfs.namenode.name.dir/current/文件夹的几个文件: 1 current/ ...

  6. POJ 1019 Number Sequence

    找规律,先找属于第几个循环,再找属于第几个数的第几位...... Number Sequence Time Limit: 1000MS Memory Limit: 10000K Total Submi ...

  7. POJ 2486 Apple Tree

    好抽象的树形DP......... Apple Tree Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6411 Accepte ...

  8. 2015baidu复赛2 连接的管道(mst && 优先队列prim)

    连接的管道 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  9. 实体ip 虚拟ip 固定ip 动态ip

    实体 IP:在网络的世界里,为了要辨识每一部计算机的位置,因此有了计算机 IP 位址的定义.一个 IP 就好似一个门牌!例如,你要去微软的网站的话,就要去『 207.46.197.101 』这个 IP ...

  10. linux 驱动程序中断号的申请

    1.linux下查看硬中断与软中断 硬中断:/proc/interrupts 软中断:/proc/softirqs 往往一些硬件中断号都是跟CPU所分配的硬件中断号相匹配的. 即同类型的cpu可能对同 ...