Introduction

The binary log contains a record of all changes to the database, both data and structure. The binary log is not used for statements such as SELECT or SHOW that do not modify data. Running a server with binary logging enabled has a slight performance effect. The binary log is crash-safe. Only complete events or transactions are logged or read back.

Why should you use binary log?

  • Replication: You stream the changes made to a server to another server using binary logs. The slave acts as a mirror copy and can be used to distribute the load. The server that accepts the writes is referred to as a master and the mirror copy server is referred to as a slave.
  • Point-in-time recovery: Suppose you take a backup at 00:00 on Sunday and your ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.