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]LeetCode1013. 将数组分成和相等的三个部分 | Partition Array Into Three Parts With Equal Sum
Given an array A of integers, return true if and only if we can partition the array into three non-e ...
- Saiku设置展示table数据不隐藏空的行数据信息(二十六)
Saiku设置展示table数据不隐藏空的行数据信息 saiku有个 非空的字段 按钮,点击这个后,会自动的把空的行数据信息给隐藏掉,这里我们来设置一下让其行数据不隐藏,为空的就为空. 主要更改两个文 ...
- 为什么公司宁愿 25K 重新招人,也不给你加到 20K?原因太现实……
年底了,还有几天就要过年了,年后必定又是一波跳槽季,我们为什么要跳槽,为什么公司不能满足我们加薪的需求? 说到这个话题,想必从事码农的各位都清楚的一个道理:工资都是跳出来的,其他行业我不太清楚,但在 ...
- JDK 8u131
JDK 8u131 发布了.Java SE 8u131 包括重要的安全修复和bug修复.Oracle 强烈建议所有 JavaSE 8 用户升级到此版本.此次完整版本号为1.8.0_131-b11. J ...
- Java:多态乃幸福本源
01 多态是什么 在我刻板的印象里,西游记里的那段孙悟空和二郎神的精彩对战就能很好的解释“多态”这个词:一个孙悟空,能七十二变:一个二郎神,也能七十二变:他们都可以变成不同的形态,但只需要悄悄地喊一声 ...
- mac缺少librt问题记录
在mac下编译一个程序的时候遇到错误 ld: library not found for -lrt librt.so主要是glibc对real-time部分的支持.所以一般含有#include< ...
- C# 之 Socket 简单入门示例
这个例子只是简单实现了如何使用 Socket 类实现面向连接的通信. 注意:此例子的目的只是为了说明用套接字写程序的大概思路,而不是实际项目中的使用程序.在这个例子中,实际上还有很多问题没有解决,如消 ...
- Solr04 - 在Jetty和Tomcat上部署Solr单机服务
目录 1 准备安装环境 2 通过内部Jetty服务器启动 3 通过配置Tomcat服务器启动 3.1 删除不需要的应用 3.2 修改服务端口 3.3 部署solr.war 3.4 扩展: 虚拟目录发布 ...
- c# 中的封装、继承、多态详解
面向对象有封装.继承.多态这三个特性,面向对象编程按照现实世界的特点来管理复杂的事物,把它们抽象为对象,具有自己的状态和行为,通过对消息的反应来完成任务.这种编程方法提供了非常强大的多样性,大大增加了 ...
- 用PMML实现机器学习模型的跨平台上线
在机器学习用于产品的时候,我们经常会遇到跨平台的问题.比如我们用Python基于一系列的机器学习库训练了一个模型,但是有时候其他的产品和项目想把这个模型集成进去,但是这些产品很多只支持某些特定的生产环 ...