MySQL 日志 redo log、undo log、binlog、relay log、general log、slow query log、errorlog

There are the following 7 types of log files in MySQL:

  1. Redo log (redo log): to ensure the durability of the transaction. After the transaction starts, the data modified during the execution is gradually written into the log buffer buffer, and then flushed to the disk. You can use the double write buffer to write twice to ensure the integrity of the data page.
  2. Rollback log (undo log): to ensure the atomicity of the transaction. Provide multi-version concurrent control reading. Each modification record will record the undo log, and use roll_pointer to string the undo log into a linked list to form a version chain.
  3. Binary log (binlog): used to achieve master-slave replication. After the main library data is modified, the binlog will be recorded and read by the slave library.
  4. Relay log: used to implement master-slave replication. The binlog of the main library is read from the library and then written to the relay log. The SQL thread writes the data to the local data by replaying the relay log.
  5. General log: disabled by default, it records every query or command received by the server.
  6. Slow query log (slow query log): Records successful query statements that take too long to execute and do not use indexes
  7. Error log (errorlog): closed by default, the error log records the start and stop of mysqld, and the related information about the errors that occurred during the operation of the server.

Guess you like

Origin blog.csdn.net/Anenan/article/details/115289979