MySQL新参数log_error_verbosity
在介绍这个参数前,我们先聊聊参数log_warnings。我们知道MySQL中,其中log_error定义是否启用错误日志的功能和错误日志的存储位置,log_warnings定义是否将告警信息(warning messages)也写入错误日志。此选项默认启用,具体来说:
log_warnings 为0, 表示不记录告警信息。
log_warnings 为1, 表示告警信息写入错误日志。
log_warnings 大于1, 表示各类告警信息,例如有关网络故障的信息和重新连接信息写入错误日志。
注意,此参数在不同版本略有差别,在MySQL 5.6中,log_warnings的默认值为1,如下所示:
|
Property |
Value |
|
Command-Line Format |
--log-warnings[=#] |
|
System Variable |
|
|
Scope (>= 5.6.4) |
Global |
|
Scope (<= 5.6.3) |
Global, Session |
|
Dynamic |
Yes |
|
Type (64-bit platforms) |
integer |
|
Type (32-bit platforms) |
integer |
|
Default Value (64-bit platforms) |
1 |
|
Default Value (32-bit platforms) |
1 |
|
Minimum Value (64-bit platforms) |
0 |
|
Minimum Value (32-bit platforms) |
0 |
|
Maximum Value (64-bit platforms) |
18446744073709551615 |
|
Maximum Value (32-bit platforms) |
4294967295 |
在MySQL 5.7中,有些版本默认值为2,有些版本默认值为1, 具体参考官方文档信息,如下所示:
|
Property |
Value |
|
Command-Line Format |
--log-warnings[=#] |
|
Deprecated |
5.7.2 |
|
System Variable |
|
|
Scope |
Global |
|
Dynamic |
Yes |
|
Type (64-bit platforms) |
integer |
|
Type (32-bit platforms) |
integer |
|
Default Value (64-bit platforms, >= 5.7.2) |
2 |
|
Default Value (64-bit platforms, <= 5.7.1) |
1 |
|
Default Value (32-bit platforms, >= 5.7.2) |
2 |
|
Default Value (32-bit platforms, <= 5.7.1) |
1 |
|
Minimum Value (64-bit platforms) |
0 |
|
Minimum Value (32-bit platforms) |
0 |
|
Maximum Value (64-bit platforms) |
18446744073709551615 |
|
Maximum Value (32-bit platforms) |
4294967295 |
Print out warnings such as Aborted connection... to the error log. This option is enabled (1) by default. To disable it, use --log-warnings=0. Specifying the option without a level value increments the current value by 1. Enabling this option by setting it greater than 0 is recommended, for example, if you use replication (you get more information about what is happening, such as messages about network failures and reconnections). If the value is greater than 1, aborted connections are written to the error log, and access-denied errors for new connection attempts are written. See Section B.5.2.11, “Communication Errors and Aborted Connections”.
If a slave server was started with --log-warnings enabled, the slave prints messages to the error log to provide information about its status, such as the binary log and relay log coordinates where it starts its job, when it is switching to another relay log, when it reconnects after a disconnect, and so forth. The server logs messages about statements that are unsafe for statement-based logging if --log-warnings is greater than 0.
将告警信息,例如连接中断等告警信息输出到错误日志。该选项默认启用(默认值为1)。要禁用它,请使用--log-warnings = 0选项。指定没有级别值的选项时,将当前值递增1. 推荐将这个值设置为大于0启用告警日志信息写入错误日志。举个例子,如果你正在使用复制(你将会获取正在发生的事情的更多详细信息,例如有关网络故障的信息和重新连接信息)。如果该值大于1,连接中断将写入错误日志,新的连接尝试访问的拒绝访问信息。参见第B.5.2.11节“通信错误和中止连接”。
如果从服务器(slave server)启动时启用了--log-warnings,则从设备将消息输出到错误日志中以提供有关其状态的信息,例如二进制日志和中继日志坐标,它在开始作业时切换到另一个中继日志,断开连接后重新连接等等。如果--log-warnings大于0,服务器将记录关于对基于语句的日志不安全的语句的消息。
注意:从MySQL 5.7.2开始,首选log_error_verbosity系统变量,而不是使用--log-warnings选项或log_warnings系统变量,这个参数从MySQL 8.0.3开始被移除了:
This system variable was removed in MySQL 8.0.3. Use the log_error_verbosity system variable instead.
而新参数log_error_verbosity更简单,它有三个可选值, 分别对应:1 错误信息;2 错误信息和告警信息; 3:错误信息、告警信息和通知信息。 具体参考官方文档,下面部分截取官方文档。
|
Property |
Value |
|
Command-Line Format |
--log-error-verbosity=# |
|
System Variable |
|
|
Scope |
Global |
|
Dynamic |
Yes |
|
SET_VAR Hint Applies |
No |
|
Type |
integer |
|
Default Value (>= 8.0.4) |
2 |
|
Default Value (<= 8.0.3) |
3 |
|
Minimum Value |
1 |
|
Maximum Value |
3 |
The verbosity for handling events intended for the error log, as filtered by the log_filter_internal error log filter component. log_error_verbosity has no effect if log_filter_internal is not enabled.
The following table shows the permitted verbosity values.
|
Desired Log Filtering |
log_error_verbosity Value |
|
Error messages |
1 |
|
Error and warning messages |
2 |
|
Error, warning, and note messages |
3 |
Selected important system messages about non-error situations, such as startup and shutdown messages, are printed to the error log when the variable value is 1.
For additional information, see Section 5.4.2.5, “Error Log Filtering”, and Section 5.5.1, “Error Log Components”.
参考资料:
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_log_warnings
https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_log-warnings
MySQL新参数log_error_verbosity的更多相关文章
- 1201MySQL配置文件mysql.ini参数详解
转自http://www.cnblogs.com/feichexia/archive/2012/11/27/mysqlconf.html my.ini(Linux系统下是my.cnf),当mysql服 ...
- (转)MySQL配置文件mysql.ini参数详解、MySQL性能优化
本文转自:http://www.cr173.com/html/18331_1.html my.ini(Linux系统下是my.cnf),当mysql服务器启动时它会读取这个文件,设置相关的运行环境参数 ...
- MySQL配置文件mysql.ini参数详解、MySQL性能优化
my.ini(Linux系统下是my.cnf),当mysql服务器启动时它会读取这个文件,设置相关的运行环境参数. my.ini分为两块:Client Section和Server Section. ...
- MySQL配置文件mysql.ini参数详解
my.ini(Linux系统下是my.cnf),当mysql服务器启动时它会读取这个文件,设置相关的运行环境参数. my.ini分为两块:Client Section和Server Section. ...
- MySql配置参数很全的Mysql配置参数说明
MySql配置参数 很全的Mysql配置参数说明 1. back_log 指定MySQL可能的连接数量.当MySQL主线程在很短的时间内得到非常多的连接请求,该参数就起作用,之后主线程花些时间(尽管很 ...
- MySQL 存储过程参数
MySQL 存储过程参数 MySQL存储过程参数简介 在现实应用中,开发的存储过程几乎都需要参数.这些参数使存储过程更加灵活和有用. 在MySQL中,参数有三种模式:IN,OUT或INOUT. IN ...
- MySQL wait_timeout参数修改
MySQL wait_timeout参数修改问题,可能经常会有DBA遇到过,下面就试验一下并看看会有什么现象. wait_timeout分为global级及session级别,如未进行配置,默认值为2 ...
- 看MySQL的参数调优及数据库锁实践有这一篇足够了
史上最强MySQL参数调优及数据库锁实践 1. 应用优化 1.2 减少对MySQL的访问 1.2.1 避免对数据进行重复检索 1.2.2 增加cache层 1.3 负载均衡 1.3.1 利用MySQL ...
- MySQL 配置参数优化
MySQL 配置参数优化 1.修改back_log参数值:由默认的50修改为500 back_log=500back_log值指出在MySQL暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中 ...
随机推荐
- [Swift]LeetCode521. 最长特殊序列 Ⅰ | Longest Uncommon Subsequence I
Given a group of two strings, you need to find the longest uncommon subsequence of this group of two ...
- [Swift]LeetCode731. 我的日程安排表 II | My Calendar II
Implement a MyCalendarTwoclass to store your events. A new event can be added if adding the event wi ...
- [Swift]LeetCode952. 按公因数计算最大组件大小 | Largest Component Size by Common Factor
Given a non-empty array of unique positive integers A, consider the following graph: There are A.len ...
- 机器学习基石笔记:Homework #1 PLA&PA相关习题
原文地址:http://www.jianshu.com/p/5b4a64874650 问题描述 程序实现 # coding: utf-8 import numpy as np import matpl ...
- LongAdder 测试
import org.slf4j.Logger;import org.slf4j.LoggerFactory; import java.util.concurrent.CountDownLatch;i ...
- pytorch学习: 构建网络模型的几种方法
利用pytorch来构建网络模型有很多种方法,以下简单列出其中的四种. 假设构建一个网络模型如下: 卷积层-->Relu层-->池化层-->全连接层-->Relu层--> ...
- VS背景设置
设置如上图的IDE背景图片 点击工具-〉扩展与更新,在联机中搜索IDE Text Background,下载IDE Text Background 然后搜索文件Maxzhang可以找到,然后打开文件, ...
- 深入探究Lua的GC算法(上)-《Lua设计与实现》
对于内存的管理,是程序在应用的时候的必需知识点,<Lua设计与实现>中对Lua语言的GC原理做了一个详细的讲解,云风的blog也对其进行了详尽的讲解Lua GC 的源码剖析 系列 给出作者 ...
- Spring Boot 2.x (十五):Dubbo + Zookeeper + 新版Dubbo Admin
Dubbo 简介 Dubbo是阿里巴巴公司开源的一个高性能优秀的服务框架,使得应用可通过高性能的RPC实现服务的输出和输入功能,可以和Spring框架无缝集成. 它提供了三大核心能力: 面向接口的远程 ...
- 痞子衡嵌入式:第一本Git命令教程(1)- 准备(init/config/.gitignore)
今天是Git系列课程第一课,痞子衡给大家要讲的是创建仓库的准备工作. 1.建仓库git init 第一步是创建一个空仓库,这是一切操作的前提. // 打开git bash命令行,切换到指定目录下 ja ...