MySQL Variables log_slow_admin_statements 数据库 参数变量解释及正确配置使用
本站中文解释
log_slow_admin_statements这个MySQL参数是用于记录使用管理权限(比如root用户)执行的慢查询的。 它将全部慢查询会写入慢查询log,包括°order by°、°group by°和”having“等操作。
要设置这个MySQL参数,可在 my.cnf/my.ini 中的 [mysqld] 后面添加:log_slow_admin_statements=1,然后重启MySQL服务器即可生效。
官方英文解释
log_slow_admin_statements
| Command-Line Format | --log-slow-admin-statements[={OFF|ON}] |
|---|---|
| System Variable | log_slow_admin_statements |
| Scope | Global |
| Dynamic | Yes |
| Type | Boolean |
| Default Value | OFF |
Include slow administrative statements in the statements
written to the slow query log. Administrative statements
include ALTER TABLE,
ANALYZE TABLE,
CHECK TABLE,
CREATE INDEX,
DROP INDEX,
OPTIMIZE TABLE, and
REPAIR TABLE.