Windows MySQL slow query open operation process

Source: Internet
Author: User

1. Slow Query function

Slow queries can help us record all SQL statements over Long_query_time, which facilitates SQL optimization.

2. Check the open status of slow query

Before you start a slow query, you need to determine if the slow query is turned on and execute the following command.

You can see that the value of log_slow_queries is off and is off. To turn on slow queries, you need to add them under My.ini mysqld.

Log-slow-queries=d:/xampp/mysql/data/mysql-slow.log (save path, can be set according to your needs)

long_query_time=2 (the maximum length of the query, which is recorded in the log if it exceeds this time)

After the add is complete, restart the MySQL service.

3. View Slow Query status

Through the above command, you can see the open status of slow query, slow query the specified execution time, slow query log and other information

4. Change the time of slow query by command

In addition to modifying the My.ini file, you can also modify the execution time of a slow query by using a command.


Windows MySQL slow query open operation process

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.