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