본문 바로가기
Database/MYSQL

Mysql 5.7 log_warnings

by 반화넬 2019. 2. 7.
반응형

log_warnings

PropertyValue
Command-Line Format--log-warnings[=#]
Deprecated5.7.2
System Variablelog_warnings
ScopeGlobal
DynamicYes
TypeInteger
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 Value0
Maximum Value (64-bit platforms)18446744073709551615
Maximum Value (32-bit platforms)4294967295
PropertyValue

Whether to produce additional warning messages to the error log. As of MySQL 5.7.2, information items previously governed by log_warnings are governed by log_error_verbosity, which is preferred over, and should be used instead of, the older log_warnings system variable. (The log_warnings system variable and --log-warnings command-line option are deprecated and will be removed in a future MySQL release.)

log_warnings is enabled by default (the default is 1 before MySQL 5.7.2, 2 as of 5.7.2). To disable it, set it to 0. If the value is greater than 0, the server logs messages about statements that are unsafe for statement-based logging. If the value is greater than 1, the server logs aborted connections and access-denied errors for new connection attempts. See Section B.6.2.10, “Communication Errors and Aborted Connections”.

If you use replication, enabling this variable by setting it greater than 0 is recommended, to get more information about what is happening, such as messages about network failures and reconnections.

If a slave server is 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.

Assigning a value to log_warnings assigns a value to log_error_verbosity and vice versa. The variables are related as follows:

As of MySQL 5.7.2, the default log level is controlled by log_error_verbosity, which has a default of 3. In addition, the default for log_warnings changes from 1 to 2, which corresponds to log_error_verbosity=3. To achieve a logging level similar to the previous default, set log_error_verbosity=2.

In MySQL 5.7.2 and higher, use of log_warnings is still permitted but maps onto use of log_error_verbosity as follows:


반응형