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_ ...
随机推荐
- ElasticSearch 6.4.3 启动报错: [Cannot assign requested address: bind]
今天在本地搭建一个测试用的最新版ElasticSearch6.4.3 的环境时,遇到一个报: [Cannot assign requested address: bind]的错误. 错误日志内容如下: ...
- Python3的桌面程序开发利器:Eric6的环境搭建、使用
本文旨在通过一个简单的demo,介绍基于Python3.PyQT5的环境下开发桌面应用程序的一种方案,当然开发Python的桌面应用程序不止是PyQT 这一种方案,还可以使用Python自带的Tkin ...
- JavaScript(三)
函数 函数就是重复执行的代码片. 函数定义与执行 <script type="text/javascript"> // 函数定义 function aa(){ aler ...
- UIButton设置标题左对齐
Button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//左对齐(UIControlContentHo ...
- 用cocoapods导入第三方库,找不到对应的文件
解决办法 1.找到TARGETS -> Build Settings -> SearchPaths -> User Header Search Paths 在后面的空白处双击 2. ...
- module.exports 和 exports(转)
CommonJS规范规定,每个模块内部,module变量代表当前模块.这个变量是一个对象,它的exports属性(即module.exports)是对外的接口.加载某个模块,其实是加载该模块的modu ...
- haskell实现简易计算器
> module Main where > import System.IO > import Data.Char > import Control.Monad > im ...
- 使用Eclipse中的SVN提交代码遇到的问题
问题: Previous operation has not finished; run 'cleanup' if it was interrupted svn: Commit failed (det ...
- JavaScript 特效之四大家族(offset/scroll/client/event)
三大系列:offset.scroll.client 事件对象:event(事件被触动时,鼠标和键盘的状态)(通过属性控制) 三大系列都是以DOM元素节点的属性形式存在的. 类比访问关系,也是以 ...
- Java 中关于基本数字类型的注意事项
局部变量需初始化才能访问 public void test() { float n; n = n + 1; } 窄化导致自增异常 short i = 3; i += 1; // 不提升 short i ...