mysql 5.7 配置文件说明
1、配置文件样例
[client]
#password=
socket=/data/var/mysql/mysql.sock [mysqld_safe]
pid-file=/data/var/mysql/mysqld.pid
log-error = /data/local/mysql-5.7./log/mysql-error.log [mysql]
socket=/data/var/mysql/mysql.sock [mysqld]
user = mysql
port =
datadir = /data/var/mysql
socket=/data/var/mysql/mysql.sock
symbolic-links=
########basic settings########
server-id =
#bind_address = 10.166.224.32
autocommit =
character_set_server=utf8mb4
skip_name_resolve =
max_connections =
max_connect_errors =
transaction_isolation = READ-COMMITTED
explicit_defaults_for_timestamp =
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 =
wait_timeout =
read_buffer_size = 16M
read_rnd_buffer_size = 32M
sort_buffer_size = 32M
########log settings########
#log_error = /data/local/mysql-5.7./log/mysql-error.log
slow_query_log =
slow_query_log_file = /data/local/mysql-5.7./log/mysql-slow.log
log_queries_not_using_indexes =
log_slow_admin_statements =
log_slow_slave_statements =
log_throttle_queries_not_using_indexes =
expire_logs_days =
long_query_time =
min_examined_row_limit =
########replication settings########
#master_info_repository = TABLE
#relay_log_info_repository = TABLE
log_bin = /data/local/mysql-5.7./log/mysql-bin
#sync_binlog =
gtid_mode = on
enforce_gtid_consistency =
#log_slave_updates
binlog_format = row
#relay_log = /data/local/mysql-5.7./log/mysql-relay.log
#relay_log_recovery =
#binlog_gtid_simple_recovery =
#slave_skip_errors = ddl_exist_errors
########innodb settings########
innodb_page_size = 16K
innodb_buffer_pool_size = 4G
#innodb_buffer_pool_instances =
#innodb_buffer_pool_load_at_startup =
#innodb_buffer_pool_dump_at_shutdown =
#innodb_lru_scan_depth =
innodb_lock_wait_timeout =
#innodb_io_capacity =
#innodb_io_capacity_max =
#innodb_flush_method = O_DIRECT
#innodb_log_group_home_dir = /data/local/mysql-5.7./log/redolog/
#innodb_undo_directory = /data/local/mysql-5.7./log/undolog/
#innodb_undo_logs =
#innodb_undo_tablespaces =
#innodb_flush_neighbors =
#innodb_log_file_size = 4G
#innodb_log_buffer_size = 16M
#innodb_purge_threads =
innodb_large_prefix =
innodb_thread_concurrency =
#innodb_print_all_deadlocks =
#innodb_strict_mode =
innodb_sort_buffer_size = 64M
########semi sync replication settings########
#plugin_dir=/data/local/mysql-5.7./lib/plugin
#plugin_load = "rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"
#loose_rpl_semi_sync_master_enabled =
#loose_rpl_semi_sync_slave_enabled =
#loose_rpl_semi_sync_master_timeout = [mysqld-5.7]
#innodb_buffer_pool_dump_pct =
innodb_page_cleaners =
#innodb_undo_log_truncate =
#innodb_max_undo_log_size = 2G
#innodb_purge_rseg_truncate_frequency =
#binlog_gtid_simple_recovery=
log_timestamps=system
#transaction_write_set_extraction=MURMUR32
#show_compatibility_56=on
2、解析
#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从的配置文件
mysql 从的配置文件 [client]port = 3306socket = /data/mysql/data/mysql.sock#default-character-set=utf8[mysq ...
- centos LAMP第三部分php,mysql配置 php配置文件 配置php的error_log 配置php的open_basedir 安装php的扩展模块 phpize mysql配置第二十一节课
centos LAMP第三部分php,mysql配置 php配置文件 配置php的error_log 配置php的open_basedir 安装php的扩展模块 phpize mysql配 ...
- mysql linux查看配置文件my.cnf位置
原文:mysql linux查看配置文件my.cnf位置 命令: mysql --help | grep 'Default options' -A 1
- docker 下修改 mysql sql_mode和配置文件
原文:docker 下修改 mysql sql_mode和配置文件 打开PowerShell 首先创建mysql容器,这里我们指定使用mysql5.7的版本 docker run -d -p 3306 ...
- MySQL服务 - MySQL程序的配置文件、参数、变量查看
查看配置文件及读取顺序 MySQL的配置文件以.cnf结尾,可能会有多个,而不同版本的MySQL程序的读取配置文件的路径也都不同,要想获取MySQL读取配置文件的顺序可以通过以下指令查看: shell ...
- mysql my.cnf配置文件详解
本配置文件针对Dell R710,双至强E5620.16G内存的硬件配置.CentOS 5.6 64位系统,MySQL 5.5.x 稳定版.适用于日IP 50-100w,PV 100-300w的站点, ...
- 如果不知道MySQL当前使用配置文件(my.cnf)的路径的解决方法
如果不知道当前使用的配置文件的路径,可以尝试下面的操作: # which mysqld /usr/local/mysql/bin/mysqld # /usr/local/mysql/bin/mysql ...
- mysql my.ini配置文件修改无效,修改mysql默认字符集
问题 开始于 使用mysql命令插入中文数据插不进去 ERROR 1366 (HY000): Incorrect string value: '\xD6\xD0\xCE\xC4' for column ...
- MySQL my.cnf 配置文件注释
以下是my.cnf配置文件参数解释 [client] port = 3309socket = /home/longxiben ...
- [Mysql]mysql windows下配置文件
环境是win7 mysql5.6版本 测试下配置文件是否可用(之前没用过windows下的msyql配置) 修改配置前查询下: mysql> show variables like '%max_ ...
随机推荐
- centos安装svn并创建版本库配置用户分组权限
1.设置aliyun安装源// 本步骤非必须, 使用aliyun安装源后, 执行yum update速度明显提升 wget -O /etc/yum.repos.d/CentOS-Base.repo h ...
- swift中Cell的内容定制
1.cellForTitle 2.register
- jmeter--001.介绍、下载与安装
一.介绍 使用场景: -1.接口测试 -2.性能测试 .... 特点: -1.开源.轻量级.插件化 -2.适合自动化和持续集成 二.下载(Windows环境) 下载网址:http://jmeter.a ...
- javaScript---RegExp
字符串是编程时涉及到的最多的一种数据结构,对字符串进行操作的需求几乎无处不在.比如判断一个字符串是否是合法的Email地址,虽然可以编程提取@前后的子串,再分别判断是否是单词和域名,但这样做不但麻烦, ...
- Servlet 文件上传
Servlet 可以与 HTML form 标签一起使用,来允许用户上传文件到服务器.上传的文件可以是文本文件或图像文件或任何文档. 本文使用到的文件有: 创建一个文件上传表单 下面的 HTML 代码 ...
- Invalid bound statement (not found): com.xsw.dao.CategoryDao.getCategoryById] with root cause
五月 30, 2018 11:11:03 上午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() fo ...
- HttpClient参观记:.net core 2.2 对HttpClient到底做了什么?
.net core 于 10月17日发布了 ASP.NET Core 2.2.0 -preview3,在这个版本中,我看到了一个很让我惊喜的新特性:HTTP Client Performance Im ...
- vue table 固定首列和首行
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name ...
- 共享文件 Ubuntu下安装Samba与Windows
Author:Xianghai Ding.Date:2019/01/08**************************************************************安装 ...
- jeecg富文本编辑器增加字体(仿宋)
jeecg富文本编辑器增加字体(仿宋) 温馨提示:jeecg 提供了 uedit 富文本的实现,如下针对的是 uedit 增加仿宋字体示例. 主要修改三个文件:plug-in\ueditor\uedi ...