[MySQL] Log File Overview

Source: Internet
Author: User

[MySQL] Log File overview the log files described here are all files of the MySQL database and have nothing to do with the specific storage engine. The error log of MySQL is similar to alert. log of Oracle. It ends with. err by default. When DBA encounters a problem, it should first query the log to obtain the error information. The query log records all database requests. These requests are not executed correctly. Slow query log the slow query log is used to record SQL statements with a long running time. You can set this threshold value using the long_query_time parameter. By default, MySQL does not start slow query logs. You can set log_slow_queries to ON to start logs. Another parameter related to the slow query log is log_queries_not_using_indexes. this parameter is ON, indicating that if the SQL statement is not indexed, it will be recorded in the slow query log. Slow query logs are mainly used to assist DBAs in optimizing SQL statements. The binary log records the changes to all databases (SELECT and SHOW are not included). The binary file is not started by default. You need to manually specify the parameter to start it. Binary logs have the following functions: 1) recovery (recovery): When a database is recovered from a full backup file, point-in-time recovery can be performed using binary logs. 2) replication: You can use it to synchronize data from the database in real time. Enabling a binary file will affect the performance (according to the official documentation, enabling a binary file will reduce the database performance by about 1%), but considering the benefits it brings, these performance losses are acceptable.

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.