2011-01-19 52 views

回答

5

您可以在my.cnf(可能爲my.ini)文件中設置該選項,無論哪裏碰巧安裝在您的機器上。命令行參數更多用於一次性覆蓋,而my.cnf用於永久性設置。

+0

我找到了my.ini,但是我添加了什麼?我似乎無法找到除log-slow-queries之外的任何其他內容,我不需要 – 2011-01-19 02:44:30

5
my.ini 

\# SERVER SECTION 

\# ---------------------------------------------------------------------- 

\# The following options will be read by the MySQL Server. Make sure that 

\# you have installed the server correctly (see above) so it reads this 

\# file. 

[mysqld] 

添加

log=filename.log 

或U可以設置的,請新新文件絕對路徑;

低於的[mysqld]

和u會發現程序數據\ MySQL的\ MySQL服務器5.1 \數據或者我真的是推薦使用everything搜索 「filename.log」

CMD

net stop mysql 

net start mysql 
0

對於慢查詢日誌添加到MY.INI

[mysqld] 
# Enable slow query log 
slow-query-log 
# Name of slow query log file 
slow_query_log_file = slow-query.log 
# Log all queries that have taken more than long_query_time seconds to execute to file 
long_query_time = 3