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_ ...
随机推荐
- CMake入门
CMake入门 CMake是一个跨平台的安装编译工具,可以用简单的语句来描述所有平台的安装(编译过程).他能够输出各种各样的makefile或者project文件,能测试编译器所支持的C++特性,类似 ...
- Spark on Yarn with HA
Spark 可以放到yarn上面去跑,这个毫无疑问.当Yarn做了HA的时候,网上会告诉你基本Spark测不需做太多的关注修改,实际不然. 除了像spark.yarn开头的相关配置外,其中一个很重要的 ...
- [LeetCode] Rotated Digits 旋转数字
X is a good number if after rotating each digit individually by 180 degrees, we get a valid number t ...
- wamp 环境安装php_mongo 或 mongodb的扩展
特别注意:momgo 与mondb 是两个不同的扩展,不是同一个,这是一个坑 1.查看你的php版本,Compiler,Thread safety版本 2.下载地址 https://pecl.php. ...
- idea 常用快捷键
=============intellij idea 快捷键============= ctrl+] 诸如{}围起来的代码块,使用该快捷键可以快速跳转至代码块的结尾处 ctrl+[ 同上,快速跳至代码 ...
- Assembly.LoadFrom加载程序集无法释放资源的解决方案
下面此方法加载程序集会导致程序集一直被占用 Assembly asm = Assembly.LoadFrom(dllPath); 解决方案: //通过此方法读取可以解决dll被占用问题 byte[] ...
- 前台js根据当前时间生成订单号
*********前台显示框**************** <input type="text" id="WIDout_trade_no" name=& ...
- sql server里中自增长的ID重新开始排
dbcc checkident('tablename',reseed,0); 执行:dbcc checkident('TableA',reseed,0); 执行结束:中途报了几次插入重复键. 结论:用 ...
- 树状数组 || JZOI 1024. @szefany 的树
题面:无 题解:无 代码: #include<cstdio> #include<cstring> #include<iostream> #include<al ...
- hadoop三个配置文件的参数含义说明
1 获取默认配置 配置hadoop,主要是配置core-site.xml,hdfs-site.xml,mapred-site.xml三个配置文件,默认下来,这些配置文件都是空的,所以很难知 ...