{"id":471,"date":"2015-06-04T09:49:03","date_gmt":"2015-06-04T14:49:03","guid":{"rendered":"http:\/\/www.g31zone.com\/?p=471"},"modified":"2015-06-04T09:49:03","modified_gmt":"2015-06-04T14:49:03","slug":"enable-slow-query-log-on-mysql-server","status":"publish","type":"post","link":"https:\/\/www.g31zone.com\/?p=471","title":{"rendered":"Enable slow query log on MySQL server"},"content":{"rendered":"<p>Set it temporarily, by running the following commands on mysql console:<\/p>\n<p><code><br \/>\nset global slow_query_log = 1;<br \/>\nset global slow_query_log_file = '\/var\/log\/mysql-slow.log';<br \/>\n<\/code><\/p>\n<p>the changes will be undone when mysql is restarted.<\/p>\n<p>Set it permanently, by adding the following in &#8220;my.cnf&#8221; file:<\/p>\n<p><code><br \/>\nslow-query-log=1<br \/>\nslow-query-log-file=\/var\/log\/mysql-slow.log<br \/>\n<\/code><\/p>\n<p>The location of <i>my.cnf<\/i> varies by OS, but is often found in <i>\/etc\/my.cnf<\/i>, or <i>\/etc\/mysql\/my.cnf<\/i>. After saving your changes, you will need to restart MySQL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Set it temporarily, by running the following commands on mysql console: set global slow_query_log = 1; set global slow_query_log_file = &#8216;\/var\/log\/mysql-slow.log&#8217;; the changes will be&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[173],"class_list":["post-471","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-mysql-slow-query-log"],"_links":{"self":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=471"}],"version-history":[{"count":1,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/471\/revisions"}],"predecessor-version":[{"id":472,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/471\/revisions\/472"}],"wp:attachment":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}