问答 百科手机端

Detailed explanation of mysql log classification

2023-06-19 14:59
Foreword

For IT practitioners, the log is very important information in the process of daily development and troubleshooting. You can learn a lot of useful information through the log, and many strange and difficult to locate problems can often be found by analyzing the log..

In mysql, various types of logs are also provided, and different types of logs have different functions. This article will provide an in-depth understanding of various logs of mysql and the use of various logs.

mysql log classification

Divided according to categories, mysql logs are mainly divided into the following categories:

  • Binary log;
  • Error log;
  • General query log;
  • Slow query log;

The above are the four well-known logs. After mysql8, added two moreLogs, relay logs and data definition statement logs, it can be said that with these logs, everything that happens inside mysql can be traced back. The specific functions of several logs are as follows:

  • Slow query log: records all execution time exceeding long_query_timeAll queries are convenient for us to optimize the query (default is not enabled);
  • General query log: records the start time and termination time of the mysql service connection, and all instructions sent to the database server (DML and DDL), for recovery
热门