MySQL Variables debug 数据库 参数变量解释及正确配置使用

本站中文解释

MySQL参数变量debug用于启用MySQL的调试模式,它会在MySQL服务器的错误日志文件中写入有价值的调试信息。

要设置MySQL参数变量debug,首先要关闭MySQL服务器,然后打开MySQL的配置文件(my.cnf),搜索debug关键字,如果没有该参数名,则在[mysqld]节点下新增debug=1参数,如果debug参数名存在,将debug参数值修改为1.最后保存配置文件,启动MySQL服务器。

官方英文解释

debug

Command-Line Format --debug[=debug_options]
System Variable debug
Scope Global, Session
Dynamic Yes
Type String
Default Value (Unix) d:t:i:o,/tmp/mysqld.trace
Default Value (Windows) d:t:i:O,\mysqld.trace

This variable indicates the current debugging settings. It is
available only for servers built with debugging support. The
initial value comes from the value of instances of the
--debug option given at server
startup. The global and session values may be set at runtime.

Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session variables. See
Section 5.1.8.1, “System Variable Privileges”.

Assigning a value that begins with + or
- cause the value to added to or subtracted
from the current value:

mysql> SET debug = 'T';
mysql> SELECT @@debug;
+---------+
| @@debug |
+---------+
| T       |
+---------+

mysql> SET debug = '+P';
mysql> SELECT @@debug;
+---------+
| @@debug |
+---------+
| P:T     |
+---------+

mysql> SET debug = '-P';
mysql> SELECT @@debug;
+---------+
| @@debug |
+---------+
| T       |
+---------+

For more information, see Section 5.8.3, “The DBUG Package”.


数据运维技术 » MySQL Variables debug 数据库 参数变量解释及正确配置使用