MySQL Log analysis

Source: Internet
Author: User
MySQL log is divided into error log, binary log, slow query log, query log 1. The error log can be used to view the file of the error log through the following command: Show variables like ' Log_error '; the above command can be used to locate the error log location, Then analyze the problem by looking at the error log document

2. Slow query log so-called Slow query log is used to record in MySQL running slow execution statement, what kind of statement can be considered slow statement, is set by the threshold of Long_query_time, the default is 10, you can use the command to view the following: show variables Like ' Long_query_time '; By default, MySQL does not start a slow SQL log, it needs to be set manually, to see if the slow SQL logs are started and the log location is used: Show variables like ' slow_query% '; Turn on Slow query: Set global slow_query_log = 1; see if it starts: show variables like ' slow_query% '; modify slow Query threshold: Set global long_query_time = 0.001; After changing the view, for example, the discovery or the default value of 10, is not set the value of 0.001, this is because the current window is not in effect after setting the full local variable, you need to exit MySQL reconnect or open a new window to view the value of the setting:

MySQL Log analysis

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.