Change or Set MySQL Long Query Time Value for log-slow-queries更改或設置MySQL的長查詢時間價值為日誌慢查詢
If you如果您 enable slow queries log of MySQL database server使緩慢查詢日誌中的MySQL數據庫服務器 , you will notice that from the slow query log file contains only SQL statements and queries that took more than query_time of 10 seconds to execute or run. ,你會發現,從慢查詢日誌文件只包含SQL語句,並查詢了超過query_time 10秒執行或執行。 This is the default value or query time threshold for log_slow_queries function, which is 10 seconds.這是默認值或查詢時間門檻log_slow_queries功能,這是10秒鐘。 10 seconds is way too long for a SQL query to complete, so the value may be too high to capture any meaningful data. 10秒的方式是太長SQL查詢來完成,所以價值可能過高,以捕獲任何有意義的數據。 You can alter or change the slow query time to lower value or number of seconds.你可以改變或改變緩慢,查詢時間,較低的價值或數量秒。
You can set a new long_query_time in the MySQL configuration file, namely my.cnf or my.ini, normally located in /etc directory.您可以設置一個新的long_query_time在MySQL配置文件,即my.cnf或my.ini ,通常位於/ etc目錄。 Simply add the following line to the configuration file:只需添加以下行的配置文件:
long_query_time = 5 long_query_time = 5
Above option will set the slow or long query limit as 5 seconds, which means MySQL will capture and log all SQL queries that took longer than 5 seconds to execute and finish running to the log file.最重要的選擇將緩慢或長期的查詢限制的5秒,這意味著MySQL的將捕捉和記錄所有的SQL查詢,長於5秒執行和完成運行日誌文件。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明:這是一台機器翻譯網頁這是“原樣”提供,無保修。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原文的文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at共享和貢獻或獲得技術支持和幫助 My Digital Life Forums 我的數字生活論壇 . 。
Related Articles相關文章
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database啟用日誌記錄慢查詢(慢速查詢日誌)在MySQL數據庫
- WordPress MySQL SQL Query Error in WPDB Class WordPress的MySQL的SQL查詢錯誤WPDB級
- Change and Reset MySQL root Password變化和重置MySQL的root密碼
- How to Escape Characters in Oracle PL/SQL Queries如何轉義字符在甲骨文特等/ SQL查詢
- You Are Not Authorized to Execute SQL Queries in vBulletin Maintenance你無權執行SQL查詢vBulletin維修
- AskEraser to Delete Private Search Queries in Ask.com AskEraser刪除私人搜索查詢在Ask.com
- Google Alert Tool to Keep You Notified with the Latest News with Customizable Query谷歌提醒工具,讓您通知最新的新聞與定制查詢
- FreeBSD 6.0 on VMware Server Time and Clock Slow Down FreeBSD的6.0 VMware服務器的時間和時鐘放慢
- Slow sFTP Transfer Speed with SSH Connection (SSH2)慢SFTP發布傳輸速度與ssh連接( SSH2 )
- Outlook 2007 Slow While Downloading POP3 Email展望2007年慢,而下載POP3電子郵件


























June 20th, 2007 00:43 07年6月20日0點43分
Stating that “10 seconds is way too long for a SQL query to complete” is slightly irresponsible, as 10 seconds might be perfectly reasonable for some queries to complete given the dataset and hardware being queried against combined with the complexity of the query.指出, “ 10秒的方式是太長SQL查詢來完成”略有不負責任的,作為10秒可能是完全合理的一些查詢,以完成特定的數據和硬件受到質疑反對合併的複雜性查詢。
Seeing as how this page is ranking quite high for people having performance issues with MySQL, I feel it is important to set this straight.如何看這個網頁是排名相當高的人具有的性能問題與MySQL ,我覺得重要的是要設定這個連勝。 One should not read this article and assume that their queries are performing unreasonably slow simply because they take over 10 seconds.我們不應該閱讀此文章,並承擔其查詢的效能不合理緩慢僅僅是因為他們採取了10秒。