"reprint" MySQL slow query

Source: Internet
Author: User

Mysql>Show variables like 'long%'; Note: This long_query_time is used to define a "slow query" that is slower than the number of seconds.+-----------------+-----------+|Variable_name|Value|+-----------------+-----------+|Long_query_time| 10.000000 | +-----------------+-----------+1Rowinch Set(0.00sec) MySQL> SetLong_query_time=1; Note: I set 1, that is, the execution time of more than 1 seconds is a slow query. Query OK,0Rows Affected (0.00sec) MySQL>Show variables like 'slow%';+---------------------+---------------+|Variable_name|Value|+---------------------+---------------+|Slow_launch_time| 2             | |Slow_query_log|  on            |Note: If logging is turned on|Slow_query_log_file| /Tmp/Slow.Log |Note: Where to set+---------------------+---------------+3Rowsinch Set(0.00sec) MySQL> SetGlobal Slow_query_log=' on'Note: Turning on logging once the Slow_query_log variable is set to On,mysql will start recording immediately. /etc/the MY.CNF can set the initial value of the MySQL global variable above. Long_query_time=1Slow_query_log_file=/Tmp/Slow.Log

Reprinted from Http://www.cnblogs.com/zhenghongxin/p/5417030.html

"reprint" MySQL slow query

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.