MySQL Variables general_log 数据库 参数变量解释及正确配置使用
本站中文解释
MySQL参数变量general_log指定MySQL的总日志保存模式。它的选项值为ON或OFF,当设置为ON时,MySQL将会记录每次连接和断开以及会话级语句的执行到一个文件中。可以通过修改MySQL配置文件my.cnf来设置general_log参数。
步骤如下:
1.打开MySQL配置文件my.cnf,
2.在文件中添加 ‘general_log=ON’ 的行,
3.将配置文件保存,
4.重启MySQL,以便配置文件中的更改生效。
官方英文解释
general_log
| Command-Line Format | --general-log[={OFF|ON}] |
|---|---|
| System Variable | general_log |
| Scope | Global |
| Dynamic | Yes |
| Type | Boolean |
| Default Value | OFF |
Whether the general query log is enabled. The value can be 0
(or OFF) to disable the log or 1 (or
ON) to enable the log. The destination for
log output is controlled by the
log_output system variable;
if that value is NONE, no log entries are
written even if the log is enabled.