MySQL notes--turn on MySQL slow query

Source: Internet
Author: User
Tags mysql slow query log

mysql Slow query log _1--How to turn on slow query log
Open MySQL slow query under Windows
MySQL configuration file in Windows system is generally my.ini find [mysqld] under the Add
Log-slow-queries=c:/program Files/mysql/mysql Server 5.1/datafiles/slowquery.log
long_query_time=2
Log-slow-admin-statements
Log-queries-not-using-indexes
MySQL slow query enabled under Linux
MySQL configuration file in Linux system is generally my.cnf find [mysqld] under the Add
Log-slow-queries=/usr/loca/mysql/datafiles/slowquery.log
long_query_time=2
Log-slow-admin-statements
Log-queries-not-using-indexes
Attention
Log-slow-queries =c:/program files/mysql/mysql Server 5.1/datafiles/ Slowquery.log for slow query log storage location, generally this directory to have MySQL running account of the writable permissions, generally set this directory as MySQL data storage directory;
Long_query_time=2 2 indicates that the query is more than two seconds before logging;
Log-queries-not-using-indexes is also a new option for 5.1, which can be logged to the slow query log without using the index SQL statement
Log-slow-admin-statements This command option can write optimize table, ANALYZE table, and ALTER TABLE for administrative operations such as slow query log.

MySQL notes--turn on 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.