Use MySQL's slow query log to find inefficient SQL statements

Source: Internet
Author: User

Title, to turn on MySQL's slow query log, you can set two items in the MySQL configuration file under [mysqld]:

Log-slow-queries = D:/soft/phpnow/mysql-5.1.50/test.log
Long_query_time = 1

Log-slow-queries represents the log book storage location, Long_query_time indicates the execution time unit is seconds, so set up after restarting the MySQL server, query more than 1 seconds of SQL statements will be recorded in the log, it is important to note that the Log_query_ Time cannot set decimals (some versions can also be set if tested).

Use MySQL's slow query log to find inefficient SQL statements

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.