mysql 5.7配置项最详细的解释
配置样例
首先提供一个我使用的配置样例
- [client]
- #password=88888888
- socket=/data/var/mysql/mysql.sock
- [mysqld_safe]
- pid-file=/data/var/mysql/mysqld.pid
- log-error = /data/local/mysql-5.7.19/log/mysql-error.log
- [mysql]
- socket=/data/var/mysql/mysql.sock
- [mysqld]
- user = mysql
- port = 31306
- datadir = /data/var/mysql
- socket=/data/var/mysql/mysql.sock
- symbolic-links=0
- ########basic settings########
- server-id = 11
- #bind_address = 10.166.224.32
- autocommit = 1
- character_set_server=utf8mb4
- skip_name_resolve = 1
- max_connections = 800
- max_connect_errors = 100
- transaction_isolation = READ-COMMITTED
- explicit_defaults_for_timestamp = 1
- join_buffer_size = 128M
- tmp_table_size = 128M
- tmpdir = /dev/shm
- max_allowed_packet = 16M
- sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
- interactive_timeout = 60
- wait_timeout = 60
- read_buffer_size = 16M
- read_rnd_buffer_size = 32M
- sort_buffer_size = 32M
- ########log settings########
- #log_error = /data/local/mysql-5.7.19/log/mysql-error.log
- slow_query_log = 1
- slow_query_log_file = /data/local/mysql-5.7.19/log/mysql-slow.log
- log_queries_not_using_indexes = 1
- log_slow_admin_statements = 1
- log_slow_slave_statements = 1
- log_throttle_queries_not_using_indexes = 10
- expire_logs_days = 90
- long_query_time = 1
- min_examined_row_limit = 100
- ########replication settings########
- #master_info_repository = TABLE
- #relay_log_info_repository = TABLE
- log_bin = /data/local/mysql-5.7.19/log/mysql-bin
- #sync_binlog = 4
- gtid_mode = on
- enforce_gtid_consistency = 1
- #log_slave_updates
- binlog_format = row
- #relay_log = /data/local/mysql-5.7.19/log/mysql-relay.log
- #relay_log_recovery = 1
- #binlog_gtid_simple_recovery = 1
- #slave_skip_errors = ddl_exist_errors
- ########innodb settings########
- innodb_page_size = 16K
- innodb_buffer_pool_size = 4G
- #innodb_buffer_pool_instances = 8
- #innodb_buffer_pool_load_at_startup = 1
- #innodb_buffer_pool_dump_at_shutdown = 1
- #innodb_lru_scan_depth = 2000
- innodb_lock_wait_timeout = 5
- #innodb_io_capacity = 4000
- #innodb_io_capacity_max = 8000
- #innodb_flush_method = O_DIRECT
- #innodb_log_group_home_dir = /data/local/mysql-5.7.19/log/redolog/
- #innodb_undo_directory = /data/local/mysql-5.7.19/log/undolog/
- #innodb_undo_logs = 128
- #innodb_undo_tablespaces = 0
- #innodb_flush_neighbors = 1
- #innodb_log_file_size = 4G
- #innodb_log_buffer_size = 16M
- #innodb_purge_threads = 4
- innodb_large_prefix = 1
- innodb_thread_concurrency = 64
- #innodb_print_all_deadlocks = 1
- #innodb_strict_mode = 1
- innodb_sort_buffer_size = 64M
- ########semi sync replication settings########
- #plugin_dir=/data/local/mysql-5.7.19/lib/plugin
- #plugin_load = "rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"
- #loose_rpl_semi_sync_master_enabled = 1
- #loose_rpl_semi_sync_slave_enabled = 1
- #loose_rpl_semi_sync_master_timeout = 5000
- [mysqld-5.7]
- #innodb_buffer_pool_dump_pct = 40
- innodb_page_cleaners = 4
- #innodb_undo_log_truncate = 1
- #innodb_max_undo_log_size = 2G
- #innodb_purge_rseg_truncate_frequency = 128
- #binlog_gtid_simple_recovery=1
- log_timestamps=system
- #transaction_write_set_extraction=MURMUR32
- #show_compatibility_56=on
详细解释
#password=88888888
socket=/data/var/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
socket=/data/var/mysql/mysql.sock
user = mysql
port = 31306
datadir = /data/var/mysql/
socket=/data/var/mysql/mysql.sock
symbolic-links=0
server-id = 11
#bind_address = 10.166.224.32
autocommit = 1
character_set_server=utf8mb4
skip_name_resolve = 1
max_connections = 800
max_connect_errors = 1000
transaction_isolation = READ-COMMITTED
2. READ-COMMITTED(读取提交内容)
3. REPEATABLE-READ(可重读)
4.SERIERLIZED(可串行化)
默认级别REPEATABLE-READ
explicit_defaults_for_timestamp = 1
join_buffer_size = 128M
tmp_table_size = 128M
tmpdir = /dev/shm/mysql-tmp/
max_allowed_packet = 16M
sql_mode =
"STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
interactive_timeout = 60
wait_timeout = 60
read_buffer_size = 16M
read_rnd_buffer_size = 32M
sort_buffer_size = 32M
#log_error = /data/local/mysql-5.7.19/log/mysql-error.log
slow_query_log = 1
slow_query_log_file = /data/local/mysql-5.7.19/log/mysql-slow.log
log_queries_not_using_indexes = 1
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_throttle_queries_not_using_indexes = 10
expire_logs_days = 90
long_query_time = 1
min_examined_row_limit = 100
#master_info_repository = TABLE
#relay_log_info_repository = TABLE
log_bin = /data/local/mysql-5.7.19/log/mysql-bin
#sync_binlog = 4
gtid_mode = on
enforce_gtid_consistency = 1
#log_slave_updates
binlog_format = row
#relay_log = /data/local/mysql-5.7.19/log/mysql-relay.log
#relay_log_recovery = 1
#binlog_gtid_simple_recovery = 1
#slave_skip_errors = ddl_exist_errors
innodb_page_size = 16K
innodb_buffer_pool_size = 4G
#innodb_buffer_pool_instances = 8
#innodb_buffer_pool_load_at_startup = 1
#innodb_buffer_pool_dump_at_shutdown = 1
#innodb_lru_scan_depth = 2000
innodb_lock_wait_timeout = 5
#innodb_io_capacity = 4000
#innodb_io_capacity_max = 8000
#innodb_flush_method = O_DIRECT
这在读取InnoDB缓冲池时可防止“双缓冲(double
buffering)”效应,否则会在文件系统缓存与InnoDB缓存间形成2个副本(copy).
如果不使用硬件RAID控制器,或者使用SAN存储时, O_DIRECT 可能会导致性能下降
#innodb_log_group_home_dir = /data/local/mysql-5.7.19/log/redolog/
#innodb_undo_directory = /data/local/mysql-5.7.19/log/undolog/
#innodb_undo_logs = 128
#innodb_undo_tablespaces = 0
tablespace文件,每个文件的默认大小为10M。修改该值会导致Innodb无法完成初始化,数据库无法启动,但是另两个参数可以修改
#innodb_flush_neighbors = 1
#innodb_log_file_size = 4G
#innodb_log_buffer_size = 16M
#innodb_purge_threads = 4
innodb_large_prefix = 1
于是增加了这个参数。这个参数默认值是OFF。当改为ON时,允许列索引最大达到3072
innodb_thread_concurrency = 64
#innodb_print_all_deadlocks = 1
#innodb_strict_mode = 1
TABLE)、更改表(ALTER TABLE)和创建索引(CREATE
INDEX)语句时,如果写法有错误,不会有警告信息,而是直接抛出错误,这样就可直接将问题扼杀在摇篮里
innodb_sort_buffer_size = 64M
#plugin_dir=/data/local/mysql-5.7.19/lib/plugin
#plugin_load = "rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"
#loose_rpl_semi_sync_master_enabled = 1
#loose_rpl_semi_sync_slave_enabled = 1
#loose_rpl_semi_sync_master_timeout = 5000
#innodb_buffer_pool_dump_pct = 40
innodb_page_cleaners = 4
#innodb_undo_log_truncate = 1
#innodb_max_undo_log_size = 2G
#innodb_purge_rseg_truncate_frequency = 128
#binlog_gtid_simple_recovery=1
这个选项设置为真,会提升mysql执行恢复的性能。因为这样mysql-server启动和binlog日志清理更快。该参数为真时,mysql-server只需打开最老的和最新的这2个binlog文件
log_timestamps=system
log,等等记录日志的显示时间参数。 在 5.7.2 之后改参数为默认 UTC
这样会导致日志中记录的时间比中国这边的慢,导致查看日志不方便。修改为 SYSTEM 就能解决问题
#transaction_write_set_extraction=MURMUR32
XXHASH64 算法。如果线上并没有使用该功能,应该设为off
#show_compatibility_56=on
mysql 5.7配置项最详细的解释的更多相关文章
- mysql group by 用法解析(详细)
在使用mysql时,有时需要查询出某个字段不重复的记录,虽然mysql提供 有distinct这个关键字来过滤掉多余的重复记录只保留一条,但往往只用它来返回不重复记录的条数,而不是用它来返回不重记录的 ...
- (转载)mysql group by 用法解析(详细)
(转载)http://blog.tianya.cn/blogger/post_read.asp?BlogID=4221189&PostID=47881614 mysql distinct 去重 ...
- (转载)Linux下安装配置MySQL+Apache+PHP+WordPress的详细笔记
Linux下安装配置MySQL+Apache+PHP+WordPress的详细笔记 Linux下配LMAP环境,花了我好几天的时间.之前没有配置过,网上的安装资料比较混乱,加上我用的版本问题,安装过程 ...
- 多机MySQL一主双从详细安装主从复制
多机MySQL一主双从详细安装 一.复制的工作原理 要想实现AB复制,那么前提是master上必须要开启二进制日志 1.首先master将数据更新记录到二进制日志文件 2.从slave start开始 ...
- 传奇身上装备升级系列脚本,以及UPGRADEITEMEX 脚本的详细参数解释
UPGRADEITEMEX 脚本的详细参数解释如下: UPGRADEITEMEX 物品位置(0-12) 属性位置(0-14) 成功机率(0-100) 点数机率(0-255) 是否破碎(0,1) 物品位 ...
- [MySQL数据库之记录的详细操作:增、改、删、单表查询、多表查询]
[MySQL数据库之记录的详细操作:增.改.删.单表查询.多表查询] 记录详细操作 增.删.改 增: insert t1(字段1,字段2,字段3) values (值1,值2,值3), (值1,值2, ...
- [MySQL数据库之表的详细操作:存储引擎、表介绍、表字段之数据类型]
[MySQL数据库之表的详细操作:存储引擎.表介绍.表字段之数据类型] 表的详细操作 存储引擎 mysql中建立的库======>文件夹 库中建立的表======>文件 用来存储数据的文件 ...
- 在Mac上安装mysql并配置环境(详细篇)
在Mac上安装mysql并配置环境(详细篇) 1.下载mysql mysql官网 这一步根据自己电脑架构选择,分为arm和x86 下载完成之后打开就可以 接下来运行安装就可以,一直下一步,设置完密码就 ...
- MySQL 高可用性—keepalived+mysql双主(有详细步骤和全部配置项解释)
博主QQ:819594300 博客地址:http://zpf666.blog.51cto.com/ 有什么疑问的朋友可以联系博主,博主会帮你们解答,谢谢支持! 前言:生产环境中一台mysql主机存在单 ...
随机推荐
- 【GIS】Vue、Leaflet、highlightmarker、bouncemarker
感谢: https://github.com/brandonxiang/leaflet.marker.highlight https://github.com/maximeh/leaflet.boun ...
- mysql性能调整三板斧
大意是,用2/8原则,多快好省的解决大部分事情.所以三板斧,仅限整体调整,不牵扯具体细节. 1.innodb 使用innodb引擎 2.innodb_buffer_pool 调整和innodb有关的参 ...
- SyntheticEvent
在react 的事件中使用SyntheticEvent 就会出现下面的报错 <input onChange={async e => { await foo() ... }} /> 那 ...
- element的form表单中如何一行显示多el-form-item标签
效果图: HTML代码: <script src="//unpkg.com/vue/dist/vue.js"></script> <script sr ...
- mtr
一般在windows 来判断网络连通性用ping 和tracert,ping的话可以来判断丢包率,tracert可以用来跟踪路由,在Linux中有一个更好的网络连通性判断工具,它可以结合ping ns ...
- 终于等到你,最强 IDE Visual Studio 2017 正式版发布
Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进,如代码导航.IntelliSense.重构.代码修复和调试等等 ...
- day_5.18_py总结
- python 写入CSV出现空白行问题及拓展
最近在学习python,要求让出表格.期间在不懂得情况下,写了些代码,运行后发现存在输入写入猴行之间存在空白行.猴发现原来问题在打开文件的方式不对. 现将我的学习交流经验分享如下: 1,自己的起初代码 ...
- 记一次 mysql 启动没反应
记一次 mysql 启动没反应 ,重启linux又可以启动 vim /var/log/mysqld.log 2018-02-04 13:22:49 28507 [ERROR] InnoDB: Cann ...
- weblogic初学笔记2-在Linux上部署项目
一.这两天在做部署项目到Linux服务器上. 网上有用war包部署的,也有把war包解压之后部署的.比如:http://www.cnblogs.com/xdp-gacl/p/4143413.html ...