0
log_slow_queries  = "C:\Program Files\MySQL\MySQL Server 5.1\mysql-slow.log" 
long_query_time  = 1 

I wrote the lines above in my.ini file. But after running my query, which is taking more than 1 second to execute, the log file is not generated. What am I doing wrong?

Thanks in advance....

PSR
  • 39,804
  • 41
  • 111
  • 151
  • Don't know about lesser operating systems, but on Linux and Unix, it will only append to a file which already exists - it won't create the file if it's not already there - try creating the file first then restart mysqld. – symcbean Mar 12 '13 at 12:52

1 Answers1

2

Please restart mysql service. Pl execute this and check : SHOW VARIABLES LIKE '%slow_query_log%'; this will help you to identify the location of the mysql slow query log file.

Angel
  • 333
  • 1
  • 5
  • can u tell me the process how to create it – PSR Mar 12 '13 at 11:19
  • did u try restarting the mysql service after making changes in your my.cnf file. that does help sometimes. – Angel Mar 12 '13 at 11:21
  • Can you refer this http://www.mydigitallife.info/enable-logging-of-slow-queries-slow-query-log-in-mysql-database/? In case the path is wrong then mysql will write in data directory also. – Angel Mar 12 '13 at 11:47