MySQL Record slow query

Source: Internet
Author: User
  1. First find the location of the my.cnf file, which can be found by sudo find/-name my.cnf
  2. Personality my.cnf File
[Mysqld]slow-query-log=1   #开启记录慢查询log_output =table   #将结果记录到数据库, if none of this is the default record to file Slow-query-log-file= ' Long_ Query_log '  #记录慢查询的文件名long_query_time =0                     #记录走过该值的慢查询log_queries_not_using_indexes         #记录不用index的查询

3. Restart MySQL after you have finished modifying

4. Enter MySQL console using show global vairables; To query the variable setting state

5. Enter the table Mysql.slow_log in the database to view the status of the record

MySQL Record 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.