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暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中 ...
随机推荐
- linux入门--Linux桌面环境(桌面系统)大比拼[附带优缺点]
早期的 Linux 系统都是不带界面的,只能通过命令来管理,比如运行程序.编辑文档.删除文件等.所以,要想熟练使用 Linux,就必须记忆很多命令. 后来随着 Windows 的普及,计算机界面变得越 ...
- MyBatis增、删、改、查
1.config.xml文件的基本配置信息 2.选择数据源 3.mybatis约定 (1)parameterType和resultType 只能传一个参数,但是我们可以传一个数组或者集合,达到传多个参 ...
- Linux 文件夹压缩命令总结
tar命令 解包:tar zxvf FileName.tar 打包:tar czvf FileName.tar DirName gz命令 解压1:gunzip FileName.gz 解压2:gzip ...
- Java中的String,StringBuilder,StringBuffer三者的区别(转载)
最近在学习Java的时候,遇到了这样一个问题,就是String,StringBuilder以及StringBuffer这三个类之间有什么区别呢,自己从网上搜索了一些资料,有所了解了之后在这里整理一下, ...
- 从.Net到Java学习第二篇——IDEA and start spring boot
从.Net到Java学习第一篇——开篇 所谓工欲善其事,必先利其器,做java开发也一样,在比较了目前最流行的几个java IDE(eclipse,myeclipse.IDEA)之后,我果断选择IDE ...
- TypeError: unorderable types: str() >= int()
1.问题描述 age=input('please enter your age') if age >=18: print('your age is',age) print('adult') el ...
- Lucene 05 - 使用Lucene的Java API实现分页查询
目录 1 Lucene的分页查询 2 代码示例 3 分页查询结果 1 Lucene的分页查询 搜索内容过多时, 需要考虑分页显示, 像这样: 说明: Lucene的分页查询是在内存中实现的. 2 代码 ...
- [四]基础数据概述之Byte详解
Byte 基本数据类型byte 的包装类 Byte 类型的对象包含一个 byte类型的字段 属性简介 构造方法 Byte的构造方法也是有两种 可以通过基本类型byt ...
- java集合框架容器 java框架层级 继承图结构 集合框架的抽象类 集合框架主要实现类
本文关键词: java集合框架 框架设计理念 容器 继承层级结构 继承图 集合框架中的抽象类 主要的实现类 实现类特性 集合框架分类 集合框架并发包 并发实现类 什么是容器? 由一个或多个确 ...
- 消息队列中间件(三)Kafka 入门指南
Kafka 来源 Kafka的前身是由LinkedIn开源的一款产品,2011年初开始开源,加入了 Apache 基金会,2012年从 Apache Incubator 毕业变成了 Apache 顶级 ...