{"id":50,"date":"2012-03-25T22:41:20","date_gmt":"2012-03-25T21:41:20","guid":{"rendered":"http:\/\/www.voldrich.net\/?p=50"},"modified":"2020-03-27T17:00:21","modified_gmt":"2020-03-27T15:00:21","slug":"mysql-query-logging-on-windows-7","status":"publish","type":"post","link":"https:\/\/www.voldrich.net\/index.php\/2012\/03\/25\/mysql-query-logging-on-windows-7\/","title":{"rendered":"MySQL query logging on Windows 7"},"content":{"rendered":"<p>I just spent 30 minutes on a seemingly trivial task. I wanted to see what the JPA is doing to my database so I decided to turn on mysql query logging. It should be simple three step operation: <\/p>\n<ul>\n<li>Edit my.ini <\/li>\n<li>add &#8220;log=query.log&#8221;. <\/li>\n<li>restart Mysql<\/li>\n<\/ul>\n<p>Tried it, did not work. I tried to put the my.ini file to all directories that MySQL is suposed to look into (c:\\, c:\\windows\\, install dir). Nothing worked. Finally I checked the MySQL service startup commands and to my surprise there was<\/p>\n<p>&#8211;defaults-file=&#8221;C:\\ProgramData\\MySQL\\MySQL Server 5.5\\my.ini&#8221;<\/p>\n<p>I used standard MySQL installation for Windows, installed it as a service so I really do not understand that this is not mentioned in manual. Or I can not read. Anyway after I edited this file and put the &#8220;log=query.log&#8221; under [mysqld] group, restarted the server and finally the log was created in <\/p>\n<p>c:\\ProgramData\\MySQL\\MySQL Server 5.5\\data\\query.log<\/p>\n<p>Heureka.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just spent 30 minutes on a seemingly trivial task. I wanted to see what the JPA is doing to my database so I decided to turn on mysql query logging. It should be simple three step operation: Edit my.ini add &#8220;log=query.log&#8221;. restart Mysql Tried it, did not work. I tried to put the my.ini [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-development"],"_links":{"self":[{"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":1,"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":710,"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/posts\/50\/revisions\/710"}],"wp:attachment":[{"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voldrich.net\/index.php\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}