Enable MySQL Query Slow Log

From Knowledge Center
Revision as of 18:48, 24 November 2018 by Ruan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To enable slow query logging, edit /etc/my.cnf

and append this config:

slow_query_log = 1
long_query_time = 1
slow_query_log_file = /var/log/mysql/slow-query.log

Great Resources: